ACE3/addons/medical_ai/functions/fnc_isSafe.sqf
BaerMitUmlaut b389740a29
Medical AI - Fix AI healing itself too fast when hit (#7955)
* Fix AI healing itself too fast when hit

* make time constants gvars

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2020-10-29 11:38:24 -05:00

22 lines
565 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
*/
(getSuppression _this == 0)
&& {CBA_missionTime - (_this getVariable [QGVAR(lastFired), -999999]) > GVAR(timeSafe_shoot)}
&& {CBA_missionTime - (_this getVariable [QGVAR(lastHit), -999999]) > GVAR(timeSafe_hit)}
&& {!(_this getVariable [QEGVAR(captives,isHandcuffed), false])}