Skip to content

Commit

Permalink
Medical - Prevent uncon AI from talking (#9776)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkIsGrim authored Feb 7, 2024
1 parent 8731bcc commit ae532c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/medical_status/functions/fnc_setUnconsciousState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,19 @@ 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 talking (yes, this needs to be explicit)
if (!isPlayer _unit && {_unit checkAIFeature "RADIOPROTOCOL"}) then {
_unit disableAI "RADIOPROTOCOL";
_unit setVariable [QGVAR(reenableRadioProtocol), true, true];
};
} else {
// Unit has woken up, no longer need to track this
_unit setVariable [QEGVAR(medical,lastWakeUpCheck), nil];

if (_unit getVariable [QGVAR(reenableRadioProtocol), false]) then {
_unit enableAI "RADIOPROTOCOL";
};
};

// This event doesn't correspond to unconscious in statemachine
Expand Down

0 comments on commit ae532c7

Please sign in to comment.