fix: command menu drop command causes crash with thirdparty bots (fixes #309)

This commit is contained in:
dmitry 2022-02-23 22:05:58 +03:00
commit 40116a201d
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37

View file

@ -344,7 +344,7 @@ bool BotSupport::findNearestPlayer (void **pvHolder, edict_t *to, float searchDi
continue; 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 continue; // filter players with parameters
} }
float distance = client.ent->v.origin.distance (to->v.origin); float distance = client.ent->v.origin.distance (to->v.origin);