Use ace_isUnconscious in anim changed EH

This commit is contained in:
PabstMirror 2015-03-13 00:45:12 -05:00
parent 55fcc60453
commit 93262f3b92
4 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ if (_state) then {
_unit setVariable [QGVAR(escortedUnit), objNull, true];
};
};
[_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
[_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
} else {
_unit setVariable [QGVAR(isEscorting), false, true];

View File

@ -52,7 +52,7 @@ if (_state) then {
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation);
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then {
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
ERROR("Handcuff animation interrupted");
systemChat format ["debug %2: new %1", _newAnimation, time];
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
@ -71,8 +71,8 @@ if (_state) then {
_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)
if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
//Break out of hands up animation loop
[_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
};

View File

@ -50,7 +50,7 @@ if (_state) then {
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation);
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then {
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
ERROR("Surrender animation interrupted");
systemChat format ["debug %2: new %1", _newAnimation, time];
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);

View File

@ -25,7 +25,7 @@ if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(com
// We only want this function to work on local machines
if (!local _unit) exitwith {
[[_unit], QUOTE(DFUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
};
// Get rid of the object we are carrying, before we go unconscious.