From 7dc34bd7fa1aca68ddd7cd0033757ab49757fe59 Mon Sep 17 00:00:00 2001 From: dmitry Date: Mon, 31 Jan 2022 20:24:50 +0300 Subject: [PATCH] fix: do not update pings for any players that are not yapb or real players (related #284) --- src/support.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/support.cpp b/src/support.cpp index 8efada4..93ef88a 100644 --- a/src/support.cpp +++ b/src/support.cpp @@ -627,9 +627,13 @@ 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; }