From 0f7f6011ae3c3949f5511aa5a0f871031f277d10 Mon Sep 17 00:00:00 2001 From: ds Date: Sat, 19 Sep 2020 13:30:43 +0300 Subject: [PATCH] fix: reverted bot ping calculation to 2.9 era. affects #160 --- src/support.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/support.cpp b/src/support.cpp index 4345290..133e745 100644 --- a/src/support.cpp +++ b/src/support.cpp @@ -596,9 +596,16 @@ void BotSupport::calculatePings () { } int part = static_cast (average.first * 0.2f); - int botPing = bot->index () / 2 + bot->m_basePing + rg.int_ (average.first - part, average.first + part) + rg.int_ (bot->m_difficulty / 2, bot->m_difficulty); + int botPing = bot->m_basePing + rg.int_ (average.first - part, average.first + part) + rg.int_ (bot->m_difficulty / 2, bot->m_difficulty); int botLoss = rg.int_ (average.second / 2, average.second); + if (botPing <= 5) { + botPing = rg.int_ (10, 23); + } + else if (botPing > 70) { + botPing = rg.int_ (30, 40); + } + client.ping = getPingBitmask (client.ent, botLoss, botPing); client.pingUpdate = true; // force resend ping }