Medical Status - Fix unconscious AI aiming at enemies (#7977)

* Fix unconscious AI aiming at enemies

* Improve handling when locality changes

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
BaerMitUmlaut 2020-11-08 23:27:10 +01:00 committed by GitHub
parent 718d282263
commit d27122fa16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,9 +52,20 @@ if (_active) then {
// Do "Unlock controls" user action, co-pilot will then have to do the "Take Controls" actions
_unit action ["UnlockVehicleControl", vehicle _unit];
};
// Disable AI aiming
if (!isPlayer _unit && {_unit checkAIFeature "WEAPONAIM"}) then {
_unit disableAI "WEAPONAIM";
_unit setVariable [QGVAR(reenableWeaponAim), true, true];
};
} else {
// Unit has woken up, no longer need to track this
_unit setVariable [QEGVAR(medical,lastWakeUpCheck), nil];
// Reenable AI aiming
if (_unit getVariable [QGVAR(reenableWeaponAim), false]) then {
_unit enableAI "WEAPONAIM";
};
};
// This event doesn't correspond to unconscious in statemachine