From 450b8dfedb61f6110beea3bffdc20941d98859fc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 6 Jul 2016 00:54:51 -0500 Subject: [PATCH] Fix order of revive loop Fix #4035 Revive loop was killing heartrate before it exited --- addons/medical/functions/fnc_reviveStateLoop.sqf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/medical/functions/fnc_reviveStateLoop.sqf b/addons/medical/functions/fnc_reviveStateLoop.sqf index bfc55ae6d8..5dcaad09c4 100644 --- a/addons/medical/functions/fnc_reviveStateLoop.sqf +++ b/addons/medical/functions/fnc_reviveStateLoop.sqf @@ -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;