ACE3/addons/medical/functions/fnc_handleLocal.sqf

35 lines
892 B
Plaintext
Raw Normal View History

/*
* Author: Glowbal
* Called when a unit switched locality
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Is local <BOOL>
*
* ReturnValue:
* None
*
* Public: No
*/
#include "script_component.hpp"
2015-08-22 14:25:10 +00:00
params ["_unit", "_local"];
if (_local) then {
// If the unit had a loop tracking its vitals, restart it locally
if (_unit getVariable[QGVAR(addedToUnitLoop),false]) then {
[_unit, true] call FUNC(addVitalLoop);
};
2015-04-17 19:27:57 +00:00
if ((_unit getVariable ["ACE_isUnconscious",false]) && {count (_unit getVariable [QGVAR(unconsciousArguments), []]) >= 6}) then {
2015-04-20 20:08:31 +00:00
private "_arguments";
_arguments = (_unit getVariable [QGVAR(unconsciousArguments), []]);
2016-03-02 10:01:39 +00:00
_arguments set [2, CBA_missionTime];
2015-04-17 19:27:57 +00:00
2015-04-20 20:08:31 +00:00
[DFUNC(unconsciousPFH), 0.1, _arguments ] call CBA_fnc_addPerFrameHandler;
2015-04-17 19:27:57 +00:00
_unit setVariable [QGVAR(unconsciousArguments), nil, true];
2015-04-17 19:27:57 +00:00
};
};