From 40116a201d39cbba678aabeadd906a9a28451ffb Mon Sep 17 00:00:00 2001 From: dmitry Date: Wed, 23 Feb 2022 22:05:58 +0300 Subject: [PATCH] fix: command menu drop command causes crash with thirdparty bots (fixes #309) --- src/support.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/support.cpp b/src/support.cpp index 93ef88a..fe7ee55 100644 --- a/src/support.cpp +++ b/src/support.cpp @@ -344,7 +344,7 @@ bool BotSupport::findNearestPlayer (void **pvHolder, edict_t *to, float searchDi continue; } - if ((sameTeam && client.team != toTeam) || (needAlive && !(client.flags & ClientFlags::Alive)) || (needBot && !isFakeClient (client.ent)) || (needDrawn && (client.ent->v.effects & EF_NODRAW)) || (needBotWithC4 && (client.ent->v.weapons & Weapon::C4))) { + if ((sameTeam && client.team != toTeam) || (needAlive && !(client.flags & ClientFlags::Alive)) || (needBot && !bots[client.ent]) || (needDrawn && (client.ent->v.effects & EF_NODRAW)) || (needBotWithC4 && (client.ent->v.weapons & Weapon::C4))) { continue; // filter players with parameters } float distance = client.ent->v.origin.distance (to->v.origin);