mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Captives - Fix adding duplicate animEH
This commit is contained in:
parent
5d7a8afb7f
commit
ef681e4332
@ -56,8 +56,11 @@ if (_state) then {
|
||||
|
||||
//Adds an animation changed eh
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
private "_animChangedEHID";
|
||||
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
if (_animChangedEHID != -1) then {
|
||||
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
};
|
||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||
params ["_unit", "_newAnimation"];
|
||||
TRACE_2("AnimChanged",_unit,_newAnimation);
|
||||
@ -67,7 +70,6 @@ if (_state) then {
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
} else {
|
||||
|
||||
_turretPath = [];
|
||||
{
|
||||
_x params ["_xUnit", "", "", "_xTurretPath"];
|
||||
@ -90,8 +92,7 @@ if (_state) then {
|
||||
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
//remove AnimChanged EH
|
||||
private "_animChangedEHID";
|
||||
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
|
@ -48,7 +48,11 @@ if (_state) then {
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
|
||||
//Adds an animation changed eh
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
private "_animChangedEHID";
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
if (_animChangedEHID != -1) then {
|
||||
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
};
|
||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||
params ["_unit", "_newAnimation"];
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
@ -64,8 +68,7 @@ if (_state) then {
|
||||
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
//remove AnimChanged EH
|
||||
private "_animChangedEHID";
|
||||
_animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user