From 84a12bcd5602041172b14ecc0a1f79cb0de3f520 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 10 Jun 2015 22:44:54 -0500 Subject: [PATCH 1/3] Can't escort when mounted (passenger actions) --- addons/captives/functions/fnc_canEscortCaptive.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 85bd8bbd3e1..1d9480fd0b1 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -23,4 +23,6 @@ PARAMS_2(_unit,_target); (_target getVariable [QGVAR(isHandcuffed), false]) && {isNull (attachedTo _target)} && {alive _target} && -{!(_target getVariable ["ACE_isUnconscious", false])} +{!(_target getVariable ["ACE_isUnconscious", false])} && +{(vehicle _unit) == _unit} && +{(vehicle _target) == _target} From 58e5bc35816660840ce355a41c78e1dabc0734e7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 13 Jun 2015 00:02:30 -0500 Subject: [PATCH 2/3] Switch unload captive to passenger actions --- addons/captives/CfgVehicles.hpp | 14 +++++++------- .../functions/fnc_canUnloadCaptive.sqf | 15 +++++---------- .../functions/fnc_doUnloadCaptive.sqf | 19 ++++--------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 3a3b0722fb6..91409884519 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -56,6 +56,13 @@ class CfgVehicles { priority = 2.2; hotkey = "L"; }; + class GVAR(UnloadCaptive) { + displayName = CSTRING(UnloadCaptive); + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); + priority = 1.2; + }; class ACE_FriskPerson { displayName = CSTRING(FriskPerson); distance = 2; @@ -111,13 +118,6 @@ class CfgVehicles { exceptions[] = {"isNotEscorting"}; \ priority = 1.2; \ }; \ - class GVAR(UnloadCaptive) { \ - displayName = CSTRING(UnloadCaptive); \ - distance = 4; \ - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \ - priority = 1.2; \ - }; \ }; \ }; diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index a86bdae5881..59e798a24c4 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -3,15 +3,14 @@ * Check if the unit can unload a captive from the vehicle. * * Arguments: - * 0: Unit that wants to unload a captive - * 1: A captive. ObjNull for the first escorted captive - * 2: Vehicle to unload a captive from + * 0: Unit that wants to unload a captive (player) + * 1: A captive loaded in a vehicle * * Return Value: * The return value * * Example: - * [player, bob, car1] call ACE_captives_fnc_canUnloadCaptive; + * [player, bob] call ACE_captives_fnc_canUnloadCaptive; * * Public: No */ @@ -19,10 +18,6 @@ private ["_cargo"]; -PARAMS_2(_unit,_vehicle); +PARAMS_2(_player,_unit); -_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway. - -_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); - -count _cargo > 0 +((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index b7fa57a7bbb..5d95189742e 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -4,29 +4,18 @@ * * Arguments: * 0: Unit that wants to unload a captive - * 1: Vehicle to unload a captive from. + * 1: A captive loaded in a vehicle * * Return Value: * Nothing * * Example: - * [bob, car] call ACE_captives_fnc_doUnloadCaptive + * [bob, prisoner] call ACE_captives_fnc_doUnloadCaptive * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_vehicle); +PARAMS_2(_unit,_target); -private ["_cargo", "_target"]; - -_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway. - -_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); - -if ((count _cargo) > 0) then { - _target = _cargo select 0; - ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); -} else { - ERROR("No captive to unload"); -}; +["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); From 45912c6ddb056ed95a9b9568ccd5de63477ce801 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 13 Jun 2015 00:12:13 -0500 Subject: [PATCH 3/3] Handcuff icon for passengerActions --- addons/interaction/functions/fnc_addPassengersActions.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index da74ddf6391..fe557e7ada0 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -32,6 +32,9 @@ _actions = []; case (commander _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa) }; default { "" }; }; + if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then { + _icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa)); + }; _actions pushBack [ [