From 122a38a6aae70cdd5b978c028a5ca6486965b9a4 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 5 Feb 2015 16:39:45 -0600 Subject: [PATCH] More Refactoring --- addons/captives/CfgVehicles.hpp | 14 +++++----- addons/captives/XEH_postInitClient.sqf | 7 ++--- addons/captives/XEH_preInit.sqf | 12 ++++---- addons/captives/config.cpp | 6 ++-- ...eCaptive.sqf => fnc_canApplyHandcuffs.sqf} | 6 ++-- .../functions/fnc_canEscortCaptive.sqf | 2 +- .../captives/functions/fnc_canFriskPerson.sqf | 2 +- .../captives/functions/fnc_canLoadCaptive.sqf | 2 +- ...Captive.sqf => fnc_canRemoveHandcuffs.sqf} | 6 ++-- .../functions/fnc_canStopEscorting.sqf | 2 +- .../functions/fnc_canUnloadCaptive.sqf | 2 +- ...keCaptive.sqf => fnc_doApplyHandcuffs.sqf} | 6 ++-- .../functions/fnc_doEscortCaptive.sqf | 2 +- .../captives/functions/fnc_doLoadCaptive.sqf | 8 ++++-- ...eCaptive.sqf => fnc_doRemoveHandcuffs.sqf} | 2 +- .../functions/fnc_doUnloadCaptive.sqf | 2 +- .../captives/functions/fnc_handleGetOut.sqf | 7 ++--- .../captives/functions/fnc_handleKilled.sqf | 4 +-- .../functions/fnc_handlePlayerChanged.sqf | 2 +- .../functions/fnc_handleUnitInitPost.sqf | 10 +++---- .../captives/functions/fnc_handleWokeUp.sqf | 2 +- ...c_setCaptive.sqf => fnc_setHandcuffed.sqf} | 28 +++++++++++-------- addons/captives/functions/fnc_surrender.sqf | 4 +-- 23 files changed, 71 insertions(+), 67 deletions(-) rename addons/captives/functions/{fnc_canTakeCaptive.sqf => fnc_canApplyHandcuffs.sqf} (62%) rename addons/captives/functions/{fnc_canReleaseCaptive.sqf => fnc_canRemoveHandcuffs.sqf} (62%) rename addons/captives/functions/{fnc_doTakeCaptive.sqf => fnc_doApplyHandcuffs.sqf} (58%) rename addons/captives/functions/{fnc_doReleaseCaptive.sqf => fnc_doRemoveHandcuffs.sqf} (76%) rename addons/captives/functions/{fnc_setCaptive.sqf => fnc_setHandcuffed.sqf} (60%) diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 059b07cfb8..b4a120bc22 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -2,21 +2,21 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_Actions { - class ACE_SetCaptive { + class ACE_ApplyHandcuffs { displayName = "$STR_ACE_Captives_SetCaptive"; distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canTakeCaptive)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doTakeCaptive)); + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); showDisabled = 0; priority = 2.4; icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); hotkey = "C"; }; - class ACE_ReleaseCaptive { + class ACE_RemoveHandcuffs { displayName = "$STR_ACE_Captives_ReleaseCaptive"; distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canReleaseCaptive)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doReleaseCaptive)); + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; priority = 2.4; @@ -27,7 +27,7 @@ class CfgVehicles { displayName = "$STR_ACE_Captives_EscortCaptive"; distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive)); - statement = QUOTE([ARR_2(_target, true)] call FUNC(doEscortCaptive)); + statement = QUOTE([ARR_3(_target, _target, true)] call FUNC(doEscortCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; icon = QUOTE(PATHTOF(UI\captive_ca.paa)); diff --git a/addons/captives/XEH_postInitClient.sqf b/addons/captives/XEH_postInitClient.sqf index ccec1d39d2..b55c9eb10c 100644 --- a/addons/captives/XEH_postInitClient.sqf +++ b/addons/captives/XEH_postInitClient.sqf @@ -1,12 +1,9 @@ #include "script_component.hpp" -[missionNamespace, "playerChanged", {_this call ACE_Captives_fnc_handlePlayerChanged}] call ACE_Core_fnc_addCustomEventhandler; - - - +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); ["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); -["SetCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); +["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler); //TODO: Medical Integration Events??? diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index b3de41ae69..e894cd1c31 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -1,19 +1,19 @@ #include "script_component.hpp" ADDON = false; - + +PREP(canApplyHandcuffs); PREP(canEscortCaptive); PREP(canFriskPerson); PREP(canLoadCaptive); -PREP(canReleaseCaptive); +PREP(canRemoveHandcuffs); PREP(canStopEscorting); -PREP(canTakeCaptive); PREP(canUnloadCaptive); +PREP(doApplyHandcuffs); PREP(doEscortCaptive); PREP(doFriskPerson); PREP(doLoadCaptive); -PREP(doReleaseCaptive); -PREP(doTakeCaptive); +PREP(doRemoveHandcuffs); PREP(doUnloadCaptive); PREP(handleGetIn); PREP(handleGetOut); @@ -22,7 +22,7 @@ PREP(handleKnockedOut); PREP(handlePlayerChanged); PREP(handleUnitInitPost); PREP(handleWokeUp); -PREP(setCaptive); +PREP(setHandcuffed); PREP(surrender); PREP(vehicleCaptiveMoveIn); PREP(vehicleCaptiveMoveOut); diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index d7cb36371d..bceeda3b2b 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -17,15 +17,13 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" -#define GVARFIX(var1) getVariable [ARR_2(QUOTE(GVAR(var1)), false)] - class ACE_canInteractConditions { class GVAR(isNotEscorting) { condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false))); }; - class GVAR(isNotCaptive) { - condition = QUOTE(!(GETVAR(player,QGVAR(isCaptive),false))); + class GVAR(isNotHandcuffed) { + condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false))); }; class GVAR(isNotSurrendering) { condition = QUOTE(!(GETVAR(player,QGVAR(isSurrender),false))); diff --git a/addons/captives/functions/fnc_canTakeCaptive.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf similarity index 62% rename from addons/captives/functions/fnc_canTakeCaptive.sqf rename to addons/captives/functions/fnc_canApplyHandcuffs.sqf index f67f6110bf..8a3d143e96 100644 --- a/addons/captives/functions/fnc_canTakeCaptive.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Checks the conditions for being able to take a unit captive + * Checks the conditions for being able to apply handcuffs * * Arguments: * 0: caller (player) @@ -18,6 +18,8 @@ PARAMS_2(_unit,_target); +//Player has cableTie, target is alive and not already handcuffed + ("ACE_CableTie" in (items _unit)) && {alive _target} && -{!(_target getVariable [QGVAR(isCaptive), false])} +{!(_target getVariable [QGVAR(isHandcuffed), false])} diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 40a3e0d560..9bcb1d258a 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -18,7 +18,7 @@ PARAMS_2(_unit,_target); -(_target getVariable [QGVAR(isCaptive), false]) && +(_target getVariable [QGVAR(isHandcuffed), false]) && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable [QGVAR(ACE_isUnconscious), false])} diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf index 6ee44b2af5..9bbf5389c3 100644 --- a/addons/captives/functions/fnc_canFriskPerson.sqf +++ b/addons/captives/functions/fnc_canFriskPerson.sqf @@ -18,6 +18,6 @@ PARAMS_2(_unit,_target); -_target getVariable [QGVAR(isCaptive), false] +_target getVariable [QGVAR(isHandcuffed), false] || {_target getVariable ["ACE_isSearchable", false]} || {_target getVariable ["ACE_isUnconscious", false]} diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index a05765b195..3b1521e2be 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -23,7 +23,7 @@ PARAMS_3(_unit,_target,_vehicle); if (isNull _target) then { _objects = attachedObjects _unit; - _objects = [_objects, {_this getVariable [QGVAR(isCaptive), false]}] call EFUNC(common,filter); + _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); _target = _objects select 0; }; diff --git a/addons/captives/functions/fnc_canReleaseCaptive.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf similarity index 62% rename from addons/captives/functions/fnc_canReleaseCaptive.sqf rename to addons/captives/functions/fnc_canRemoveHandcuffs.sqf index 50b4c55310..f36488fbf1 100644 --- a/addons/captives/functions/fnc_canReleaseCaptive.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Checks the conditions for being able to release a captive + * Checks the conditions for being able to remove handcuffs * * Arguments: * 0: caller (player) @@ -18,6 +18,6 @@ PARAMS_2(_unit,_target); -//Unit is captive and not being escorted -_target getVariable [QGVAR(isCaptive), false] && +//Unit is handcuffed and not currently being escorted +_target getVariable [QGVAR(isHandcuffed), false] && {isNull (attachedTo _target)} diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index 4f30e7a82a..66cf12c9fc 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -33,7 +33,7 @@ if (isNull _target) exitWith { _isAttached = _target in (attachedObjects _unit); -if (_isAttached && (!(_target getVariable [QGVAR(isCaptive), false]))) exitWith { +if (_isAttached && (!(_target getVariable [QGVAR(isHandcuffed), false]))) exitWith { ERROR("Attached But Not Captive"); false }; diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 1aef4602e1..3e014d72c7 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -23,6 +23,6 @@ PARAMS_2(_unit,_vehicle); _cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway. -_cargo = [_cargo, {_this getVariable [QGVAR(isCaptive), false]}] call EFUNC(common,filter); +_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); count _cargo > 0 diff --git a/addons/captives/functions/fnc_doTakeCaptive.sqf b/addons/captives/functions/fnc_doApplyHandcuffs.sqf similarity index 58% rename from addons/captives/functions/fnc_doTakeCaptive.sqf rename to addons/captives/functions/fnc_doApplyHandcuffs.sqf index 8deb712d09..9ae82916f7 100644 --- a/addons/captives/functions/fnc_doTakeCaptive.sqf +++ b/addons/captives/functions/fnc_doApplyHandcuffs.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Checks the conditions for being able to take a unit captive + * Checks the conditions for being able to apply handcuffs * * Arguments: * 0: caller (player) @@ -18,5 +18,5 @@ PARAMS_2(_unit,_target); -_unit removeItem 'ACE_CableTie'; -["SetCaptive", [_target], [_target, true]] call EFUNC(common,targetEvent); +_unit removeItem "ACE_CableTie"; +["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 05dc912205..d782bd8c62 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -19,7 +19,7 @@ PARAMS_3(_unit,_target,_state); -if !("ACE_Handcuffed" in ([_target] call ACE_Core_fnc_getCaptivityStatus)) exitWith { +if !("ACE_Handcuffed" in ([_target] call EFUNC(common,getCaptivityStatus))) exitWith { [localize "STR_ACE_Captives_NoCaptive"] call EFUNC(common,displayTextStructured); }; diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 1ef650b4ee..92d1adecf8 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -21,14 +21,16 @@ PARAMS_3(_unit,_target,_vehicle); if (isNull _target) then { _objects = attachedObjects _unit; - _objects = [_objects, {_this getVariable [QGVAR(isCaptive), false]}] call EFUNC(common,filter); - _target = _objects select 0; + _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); + if ((count _objects) > 0) then {_target = _objects select 0;}; }; +if (isNull _target) exitWith {}; if (isNull _vehicle) then { _objects = nearestObjects [_unit, ["Car_F", "Tank_F", "Helicopter_F", "Boat_F", "Plane_F"], 10]; - _vehicle = _objects select 0; + if ((count _objects) > 0) then {_vehicle = _objects select 0;}; }; +if (isNull _vehicle) exitWith {}; if ((!isNil "_target") && {!isNil "_vehicle"}) then { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_doReleaseCaptive.sqf b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf similarity index 76% rename from addons/captives/functions/fnc_doReleaseCaptive.sqf rename to addons/captives/functions/fnc_doRemoveHandcuffs.sqf index a807959565..01ca4ef436 100644 --- a/addons/captives/functions/fnc_doReleaseCaptive.sqf +++ b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf @@ -18,4 +18,4 @@ PARAMS_2(_unit,_target); -["SetCaptive", [_target], [_target, false]] call EFUNC(common,targetEvent); +["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index 1a6b6a2d0c..b4814fc564 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -22,7 +22,7 @@ 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(isCaptive), false]}] call EFUNC(common,filter); +_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); if ((count _cargo) > 0) then { _target = _cargo select 0; diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index 84c856ed39..00368532e7 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -19,12 +19,11 @@ PARAMS_3(_vehicle,_dontcare,_unit); -if ((local _unit)&&(_unit getVariable [QGVAR(isCaptive), false])) then { - +if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { private ["_cargoIndex"]; - + _cargoIndex = _unit getVariable ["ACE_Captives_CargoIndex", -1]; - + //If captive was not "unloaded", then move them back into the vehicle. if (_cargoIndex != -1) exitWith { _unit moveInCargo [_vehicle, _cargoIndex]; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 6e41fa801a..5ac2935a2e 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -17,8 +17,8 @@ PARAMS_1(_oldUnit); -if (_oldUnit getVariable [QGVAR(isCaptive), false]) then { - _oldUnit setVariable [QGVAR(isCaptive), false, true]; +if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then { + _oldUnit setVariable [QGVAR(isHandcuffed), false, true]; }; if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index d7efa70a5f..c3e148d6c4 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -18,7 +18,7 @@ PARAMS_2(_unit,_oldUnit); -if (_unit getVariable [QGVAR(isCaptive), false]) then { +if (_unit getVariable [QGVAR(isHandcuffed), false]) then { showHUD false; } else { showHUD true; diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf index a0e76c0a10..4450378129 100644 --- a/addons/captives/functions/fnc_handleUnitInitPost.sqf +++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf @@ -17,13 +17,13 @@ PARAMS_1(_unit); -// prevent players from throwing grenades -[_unit, "Throw", {(_this select 1) getVariable [QGVAR(isCaptive), false]}, {}] call EFUNC(common,addActionEventhandler); +// prevent players from throwing grenades (added to all units) +[_unit, "Throw", {(_this select 1) getVariable [QGVAR(isHandcuffed), false]}, {}] call EFUNC(common,addActionEventhandler); if (local _unit) then { // reset status on mission start - if (_unit getVariable [QGVAR(isCaptive), false]) then { - _unit setVariable [QGVAR(isCaptive), false]; - [_unit, true] call FUNC(setCaptive); + if (_unit getVariable [QGVAR(isHandcuffed), false]) then { + _unit setVariable [QGVAR(isHandcuffed), false]; + [_unit, true] call FUNC(setHandcuffed); }; }; diff --git a/addons/captives/functions/fnc_handleWokeUp.sqf b/addons/captives/functions/fnc_handleWokeUp.sqf index 2973aa7f83..af59b5c56e 100644 --- a/addons/captives/functions/fnc_handleWokeUp.sqf +++ b/addons/captives/functions/fnc_handleWokeUp.sqf @@ -17,7 +17,7 @@ PARAMS_1(_unit); -if (_unit getVariable [QGVAR(isCaptive), false] && {vehicle _unit == _unit}) then { +if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_setCaptive.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf similarity index 60% rename from addons/captives/functions/fnc_setCaptive.sqf rename to addons/captives/functions/fnc_setHandcuffed.sqf index eca34b3bac..94967dfb20 100644 --- a/addons/captives/functions/fnc_setCaptive.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -1,6 +1,6 @@ /* * Author: Nic547, commy2 - * Makes a civilian unable to move. + * Handcuffs a unit * * Arguments: * 0: Unit @@ -18,18 +18,26 @@ PARAMS_2(_unit,_state); -if (!local _unit) exitWith {[[_unit, _state, true], _fnc_scriptName, _unit] call ACE_Core_fnc_execRemoteFnc}; +systemChat format ["set %1", _this]; + +if (!local _unit) exitWith { + ERROR("setHandcuffed unit not local"); +}; + +systemChat format ["set %1 %2 ", _state, (_unit getVariable [QGVAR(isHandcuffed), false])]; + +if (_state isEqualTo (_unit getVariable [QGVAR(isHandcuffed), false])) exitWith { + ERROR("new state equals current"); +}; if (_state) then { - if (_unit getVariable [QGVAR(isCaptive), false]) exitWith {}; - - _unit setVariable [QGVAR(isCaptive), true, true]; + _unit setVariable [QGVAR(isHandcuffed), true, true]; // fix anim on mission start (should work on dedicated servers) _unit spawn { - [_this, "ACE_Handcuffed", true] call ACE_Core_fnc_setCaptivityStatus; + [_this, QGVAR(Handcuffed), true] call EFUNC(common,setCaptivityStatus); - if (_this getVariable [QGVAR(isCaptive), false] && {vehicle _this == _this}) then { + if (_this getVariable [QGVAR(isHandcuffed), false] && {vehicle _this == _this}) then { [_this] call EFUNC(common,fixLoweredRifleAnimation); [_this, "ACE_AmovPercMstpScapWnonDnon", 0] spawn EFUNC(common,doAnimation); }; @@ -41,10 +49,8 @@ if (_state) then { showHUD false; }; } else { - if !(_unit getVariable [QGVAR(isCaptive), false]) exitWith {}; - - _unit setVariable [QGVAR(isCaptive), false, true]; - [_unit, "ACE_Handcuffed", false] call ACE_Core_fnc_setCaptivityStatus; + _unit setVariable [QGVAR(isHandcuffed), false, true]; + [_unit, "ACE_Handcuffed", false] call EFUNC(common,setCaptivityStatus); if (vehicle _unit == _unit) then { [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_surrender.sqf b/addons/captives/functions/fnc_surrender.sqf index 3d3b65ec49..69098c19a1 100644 --- a/addons/captives/functions/fnc_surrender.sqf +++ b/addons/captives/functions/fnc_surrender.sqf @@ -24,7 +24,7 @@ if (_state) then { if (_unit getVariable [QGVAR(isSurrender), false]) exitWith {}; _unit setVariable [QGVAR(isSurrender), true, true]; - [_unit, "ACE_Surrendered", true] call ACE_Core_fnc_setCaptivityStatus; + [_unit, "ACE_Surrendered", true] call EFUNC(common,setCaptivityStatus); _unit spawn { // fix for lowered rifle animation glitch @@ -49,7 +49,7 @@ if (_state) then { _this playMoveNow "unconscious"; }; - [_this, "ACE_Surrendered", false] call ACE_Core_fnc_setCaptivityStatus; + [_this, "ACE_Surrendered", false] call EFUNC(common,setCaptivityStatus); if (isPlayer _this) then {showHUD true}; };