ACE3/addons/medical/functions/fnc_handleLocal.sqf

34 lines
825 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 (_unit getvariable[QGVAR(addedToUnitLoop),false]) then {
[_unit, true] call FUNC(addToInjuredCollection);
};
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), []]);
_arguments set [2, ACE_time];
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
2015-04-20 20:08:31 +00:00
_unit setvariable [QGVAR(unconsciousArguments), nil, true];
2015-04-17 19:27:57 +00:00
};
};