fix: do not update pings for any players that are not yapb or real players (related #284)

This commit is contained in:
dmitry 2022-01-31 20:24:50 +03:00
commit 7dc34bd7fa
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37

View file

@ -628,8 +628,12 @@ void BotSupport::emitPings (edict_t *to) {
// missing from sdk
constexpr int kGamePingSVC = 17;
auto isThirdpartyBot = [] (edict_t *ent) {
return !bots[ent] && (ent->v.flags & FL_FAKECLIENT);
};
for (auto &client : m_clients) {
if (!(client.flags & ClientFlags::Used) || client.ent == game.getLocalEntity () || !bots[client.ent]) {
if (!(client.flags & ClientFlags::Used) || client.ent == game.getLocalEntity () || isThirdpartyBot (client.ent)) {
continue;
}