2015-03-08 16:50:06 +00:00
|
|
|
/*
|
|
|
|
* 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"];
|
2015-03-08 16:50:06 +00:00
|
|
|
if (_local) then {
|
2015-11-30 16:27:09 +00:00
|
|
|
if (_unit getVariable[QGVAR(addedToUnitLoop),false]) then {
|
2015-03-08 16:50:06 +00:00
|
|
|
[_unit, true] call FUNC(addToInjuredCollection);
|
|
|
|
};
|
2015-04-17 19:27:57 +00:00
|
|
|
|
2015-11-30 16:27:09 +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";
|
2015-11-30 16:27:09 +00:00
|
|
|
_arguments = (_unit getVariable [QGVAR(unconsciousArguments), []]);
|
2015-05-21 16:42:44 +00:00
|
|
|
_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-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(unconsciousArguments), nil, true];
|
2015-04-17 19:27:57 +00:00
|
|
|
};
|
2015-03-08 16:50:06 +00:00
|
|
|
};
|