fix: reverted bot ping calculation to 2.9 era. affects #160

This commit is contained in:
ds 2020-09-19 13:30:43 +03:00
commit 0f7f6011ae

View file

@ -596,9 +596,16 @@ void BotSupport::calculatePings () {
}
int part = static_cast <int> (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
}