Skip to content

Commit

Permalink
Merge pull request #4056 from acemod/fixReviveLoop
Browse files Browse the repository at this point in the history
Fix order of revive loop
  • Loading branch information
thojkooi authored Jul 6, 2016
2 parents 4047c44 + 450b8df commit 62a0c49
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions addons/medical/functions/fnc_reviveStateLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

0 comments on commit 62a0c49

Please sign in to comment.