fix: prevent hearing player entities with some flags (ref #605)

This commit is contained in:
jeefo 2024-08-01 14:19:56 +03:00
commit 68993aa434
No known key found for this signature in database
GPG key ID: D696786B81B667C8

View file

@ -3986,7 +3986,8 @@ void Bot::updateHearing () {
continue; continue;
} }
if (!game.checkVisibility (client.ent, set)) { // ignore invincible, no-target and not potentially visible players
if (isEnemyInvincible (client.ent) || isEnemyNoTarget (client.ent) || !game.checkVisibility (client.ent, set)) {
continue; continue;
} }
const float distanceSq = client.noise.pos.distanceSq (pev->origin); const float distanceSq = client.noise.pos.distanceSq (pev->origin);