ACE3/addons/medical_ai/XEH_postInit.sqf
BaerMitUmlaut 728f556ae4
Medical AI - Use suppressed EH to determine safety of AI (#8242)
* Use suppressed EH to determine safety of AI

* Require CBA 3.15.3

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: BrettMayson <brett@mayson.io>
2023-06-23 18:59:11 -03:00

24 lines
813 B
Plaintext

#include "script_component.hpp"
["CBA_settingsInitialized", {
TRACE_1("settingsInitialized", GVAR(enabledFor));
if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled
if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients
["ace_firedNonPlayer", {
_unit setVariable [QGVAR(lastFired), CBA_missionTime];
}] call CBA_fnc_addEventHandler;
["CAManBase", "Hit", {
params ["_unit"];
_unit setVariable [QGVAR(lastHit), CBA_missionTime];
}] call CBA_fnc_addClassEventHandler;
["CAManBase", "Suppressed", {
params ["_unit"];
_unit setVariable [QGVAR(lastSuppressed), CBA_missionTime];
}] call CBA_fnc_addClassEventHandler;
#include "stateMachine.sqf"
}] call CBA_fnc_addEventHandler;