ACE3/addons/ai/functions/fnc_assignNVGpfh.sqf
jonpas 938f421ac3
AI - Add automatic NVG equip/unequip (#9313)
Co-authored-by: Dystopian <sddex@ya.ru>
Co-authored-by: Mike-MF <TyroneMF@hotmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2023-09-05 16:20:06 +02:00

28 lines
546 B
Plaintext

#include "script_component.hpp"
/*
* Author: Jonpas
* waitAndExecute Handler for periodic NVG assignment.
*
* Arguments:
* None
* Return Value:
* None
*
* Example:
* [] call ace_ai_fnc_assignNVGpfh
*
* Public: No
*/
TRACE_1("assignNVGpfh",count allUnits);
if (!GVAR(assignNVG)) exitWith { TRACE_1("shutdown loop",_this); GVAR(assignNVGthread) = false; };
GVAR(assignNVGstate) = sunOrMoon < 1 || {moonIntensity > 0.8};
{
_x call FUNC(assignNVG);
} forEach allUnits;
[FUNC(assignNVGpfh), [], 300] call CBA_fnc_waitAndExecute;