ACE3/addons/medical_ai/functions/fnc_isSafe.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

22 lines
641 B
Plaintext

#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Checks if a unit is currently considered safe enough to treat itself.
*
* Arguments:
* Unit <OBJECT>
*
* Return Value:
* Is unit safe enough <BOOL>
*
* Example:
* call ACE_medical_ai_fnc_isSafe
*
* Public: No
*/
(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])}