diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 06a6f95e5e..32cd476344 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -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; - diff --git a/addons/medical_ai/XEH_preInit.sqf b/addons/medical_ai/XEH_preInit.sqf index 8dcb0111d7..79bc508bab 100644 --- a/addons/medical_ai/XEH_preInit.sqf +++ b/addons/medical_ai/XEH_preInit.sqf @@ -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; diff --git a/addons/medical_ai/functions/fnc_isSafe.sqf b/addons/medical_ai/functions/fnc_isSafe.sqf index 93ac425602..0887d10351 100644 --- a/addons/medical_ai/functions/fnc_isSafe.sqf +++ b/addons/medical_ai/functions/fnc_isSafe.sqf @@ -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])}