mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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>
This commit is contained in:
parent
2b0db19807
commit
b389740a29
@ -9,6 +9,11 @@
|
||||
_unit setVariable [QGVAR(lastFired), CBA_missionTime];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
["CAManBase", "Hit", {
|
||||
params ["_unit"];
|
||||
_unit setVariable [QGVAR(lastHit), CBA_missionTime];
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
|
||||
#include "stateMachine.sqf"
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
@ -8,4 +8,8 @@ PREP_RECOMPILE_END;
|
||||
|
||||
#include "initSettings.sqf"
|
||||
|
||||
// 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; };
|
||||
|
||||
ADDON = true;
|
||||
|
@ -16,5 +16,6 @@
|
||||
*/
|
||||
|
||||
(getSuppression _this == 0)
|
||||
&& {CBA_missionTime - (_this getVariable [QGVAR(lastFired), -30]) > 30}
|
||||
&& {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])}
|
||||
|
Loading…
Reference in New Issue
Block a user