Grenades - Fix unconscious AI being affected by flashbangs (#9978)

* Stop players being affected by AI flashbang code

* Stop affecting unconscious AI

* Update fnc_flashbangExplosionEH.sqf
This commit is contained in:
johnb432 2024-04-29 04:49:36 +02:00 committed by GitHub
parent 7c4f4cf8f8
commit 0f5b7c8762
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,12 +41,12 @@ if (hasInterface) then {
}, [_light], 0.1] call CBA_fnc_waitAndExecute;
};
// Affect local AI
// Affect local AI (players are not local, except for ACE_player)
// @todo: Affect units in static weapons, turned out, etc
private _affected = (ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20];
_affected = _affected - [ACE_player];
{
if (local _x && {alive _x}) then {
if (local _x && {_x call EFUNC(common,isAwake)}) then {
private _unit = _x;
private _strength = 1 - (((eyePos _unit) vectorDistance _grenadePosASL) min 20) / 20;