Fix order of revive loop

Fix #4035
Revive loop was killing heartrate before it exited
This commit is contained in:
PabstMirror 2016-07-06 00:54:51 -05:00
parent 4047c44b64
commit 450b8dfedb

View File

@ -21,13 +21,6 @@ if (!local _unit) exitWith {};
private _startTime = _unit getVariable [QGVAR(reviveStartTime), 0];
// Remove heartbeat
if (GVAR(level) >= 2) then {
if (_unit getVariable [QGVAR(heartRate), 60] > 0) then {
_unit setVariable [QGVAR(heartRate), 0];
};
};
// If we are in revive state in a blown up vehicle, try to unload so that people can access the body
if ((alive _unit) && {(vehicle _unit) != _unit} && {!alive (vehicle _unit)}) then {
TRACE_2("Unloading", _unit, vehicle _unit);
@ -52,5 +45,12 @@ if !(_unit getVariable [QGVAR(inReviveState), false]) exitwith {
_unit setVariable [QGVAR(reviveStartTime), nil];
};
// Remove heartbeat
if (GVAR(level) >= 2) then {
if (_unit getVariable [QGVAR(heartRate), 60] > 0) then {
_unit setVariable [QGVAR(heartRate), 0];
};
};
// Schedule the loop to be executed again 1 sec later
[DFUNC(reviveStateLoop), [_unit], 1] call CBA_fnc_waitAndExecute;