From 37216d51449665287dde4e9c3bdb702895887f2b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 17 Feb 2015 17:05:07 -0600 Subject: [PATCH] Remove HandCuff animEH --- addons/captives/functions/fnc_setHandcuffed.sqf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index cec1a007e7..0deb68dc8b 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -58,13 +58,19 @@ if (_state) then { [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; }]; - _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID]; + _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; }; }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute); } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); + + //remove AnimChanged EH + _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; + _unit removeEventHandler ["AnimChanged", _animChangedEHID]; + _unit setVariable [QGVAR(handcuffAnimEHID), -1]; + if ((vehicle _unit) == _unit) then { //Break out of hands up animation loop (doAnimation handles Unconscious prioity) [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);