mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix the delay timing when a unit switch to Captive (#5338)
This commit is contained in:
@ -56,7 +56,7 @@ if (_unit == ACE_player) then {
|
|||||||
// if we have unconsciousness for AI disabled, we will kill the unit instead
|
// if we have unconsciousness for AI disabled, we will kill the unit instead
|
||||||
private _isDead = false;
|
private _isDead = false;
|
||||||
if (!([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) && !_force) then {
|
if (!([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) && !_force) then {
|
||||||
_enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)];
|
private _enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)];
|
||||||
if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) then {
|
if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) then {
|
||||||
[_unit, true] call FUNC(setDead);
|
[_unit, true] call FUNC(setDead);
|
||||||
_isDead = true;
|
_isDead = true;
|
||||||
@ -99,15 +99,19 @@ if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
|
|||||||
if (GVAR(delayUnconCaptive) == 0) then {
|
if (GVAR(delayUnconCaptive) == 0) then {
|
||||||
[_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set);
|
[_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set);
|
||||||
} else {
|
} else {
|
||||||
|
// when the Delay is so high that the unit can wake up and get uncon again we need to check if it is the correct wait that got executed
|
||||||
|
private _counter = _unit getVariable [QGVAR(unconsciousCounter), 0];
|
||||||
|
_counter = _counter + 1;
|
||||||
|
_unit setVariable [QGVAR(unconsciousCounter), _counter];
|
||||||
[{
|
[{
|
||||||
params ["_unit"];
|
params ["_unit", "_counter"];
|
||||||
if (_unit getVariable ["ACE_isUnconscious", false]) then {
|
if (_unit getVariable ["ACE_isUnconscious", false] && (_unit getVariable [QGVAR(unconsciousCounter), 0]) == _counter) then {
|
||||||
[_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set);
|
[_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set);
|
||||||
};
|
};
|
||||||
},[_unit], GVAR(delayUnconCaptive)] call CBA_fnc_waitAndExecute;
|
},[_unit, _counter], GVAR(delayUnconCaptive)] call CBA_fnc_waitAndExecute;
|
||||||
};
|
};
|
||||||
|
|
||||||
_anim = [_unit] call EFUNC(common,getDeathAnim);
|
private _anim = [_unit] call EFUNC(common,getDeathAnim);
|
||||||
[_unit, _anim, 1, true] call EFUNC(common,doAnimation);
|
[_unit, _anim, 1, true] call EFUNC(common,doAnimation);
|
||||||
[{
|
[{
|
||||||
params ["_unit", "_anim"];
|
params ["_unit", "_anim"];
|
||||||
|
Reference in New Issue
Block a user