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>
This commit is contained in:
BaerMitUmlaut 2023-06-23 23:59:11 +02:00 committed by GitHub
parent e5654914cc
commit 728f556ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -14,6 +14,10 @@
_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;

View File

@ -11,5 +11,6 @@ PREP_RECOMPILE_END;
// default time values for AI being ready to heal, used in fnc_isSafe
if (isNil QGVAR(timeSafe_shoot)) then { GVAR(timeSafe_shoot) = 30; };
if (isNil QGVAR(timeSafe_hit)) then { GVAR(timeSafe_hit) = 30; };
if (isNil QGVAR(timeSafe_suppressed)) then { GVAR(timeSafe_suppressed) = 30; };
ADDON = true;

View File

@ -15,7 +15,7 @@
* Public: No
*/
(getSuppression _this == 0)
&& {CBA_missionTime - (_this getVariable [QGVAR(lastFired), -999999]) > GVAR(timeSafe_shoot)}
(CBA_missionTime - (_this getVariable [QGVAR(lastFired), -999999]) > GVAR(timeSafe_shoot))
&& {CBA_missionTime - (_this getVariable [QGVAR(lastHit), -999999]) > GVAR(timeSafe_hit)}
&& {CBA_missionTime - (_this getVariable [QGVAR(lastSuppressed), -999999]) > GVAR(timeSafe_suppressed)}
&& {!(_this getVariable [QEGVAR(captives,isHandcuffed), false])}