From ca980379c8dfb6e41b50221fd4e6ca519bb42593 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 25 Apr 2015 16:03:21 -0500 Subject: [PATCH] Minor captive cleanup --- addons/captives/CfgVehicles.hpp | 9 ++------- addons/captives/functions/fnc_doEscortCaptive.sqf | 10 ++++------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 10b2d0285f..1e2eb3f201 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -101,25 +101,20 @@ class CfgVehicles { #define MACRO_LOADUNLOADCAPTIVE \ class ACE_Actions { \ class ACE_MainActions { \ - selection = ""; \ - class ACE_LoadCaptive { \ + class GVAR(LoadCaptive) { \ displayName = "$STR_ACE_Captives_LoadCaptive"; \ distance = 4; \ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ exceptions[] = {"isNotEscorting"}; \ - showDisabled = 0; \ priority = 1.2; \ - hotkey = "L"; \ }; \ - class ACE_UnloadCaptive { \ + class GVAR(UnloadCaptive) { \ displayName = "$STR_ACE_Captives_UnloadCaptive"; \ distance = 4; \ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \ - showDisabled = 0; \ priority = 1.2; \ - hotkey = "C"; \ }; \ }; \ }; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 08f44a1437..b8758065d8 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -22,7 +22,7 @@ PARAMS_3(_unit,_target,_state); if (_state) then { if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {}; - [_unit, _target] call EFUNC(common,claim); + [_unit, _target, false] call EFUNC(common,claim); _unit setVariable [QGVAR(isEscorting), true, true]; _target attachTo [_unit, [0, 1, 0]]; @@ -34,8 +34,7 @@ if (_state) then { {[(_this select 0), ((_this select 0) getVariable [QGVAR(escortedUnit), objNull]), false] call FUNC(doEscortCaptive);}, nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; - private "_escortFnc"; - _escortFnc = { + [{ EXPLODE_3_PVT((_this select 0),_unit,_target,_actionID); if (_unit getVariable [QGVAR(isEscorting), false]) then { if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then { @@ -45,13 +44,12 @@ if (_state) then { if (!(_unit getVariable [QGVAR(isEscorting), false])) then { [(_this select 1)] call cba_fnc_removePerFrameHandler; - [objNull, _target] call EFUNC(common,claim); + [objNull, _target, false] call EFUNC(common,claim); detach _target; _unit removeAction _actionID; _unit setVariable [QGVAR(escortedUnit), objNull, true]; }; - }; - [_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; + }, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; } else { _unit setVariable [QGVAR(isEscorting), false, true];