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 {
|
2016-02-28 23:12:56 +00:00
|
|
|
// If the unit had a loop tracking its vitals, restart it locally
|
2015-11-30 16:27:09 +00:00
|
|
|
if (_unit getVariable[QGVAR(addedToUnitLoop),false]) then {
|
2016-02-28 23:12:56 +00:00
|
|
|
[_unit, true] call FUNC(addVitalLoop);
|
2015-03-08 16:50:06 +00:00
|
|
|
};
|
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), []]);
|
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
|
|
|
|
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
|
|
|
};
|