From 68993aa434a35690b2fb38bd23eb7561c2e10622 Mon Sep 17 00:00:00 2001 From: jeefo Date: Thu, 1 Aug 2024 14:19:56 +0300 Subject: [PATCH] fix: prevent hearing player entities with some flags (ref #605) --- src/botlib.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index db92bec..a866f9d 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -3986,7 +3986,8 @@ void Bot::updateHearing () { 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; } const float distanceSq = client.noise.pos.distanceSq (pev->origin);