fix: pingfaker overwrites pings for real players (resolves #572)

fix: crash bug introduced in #569
This commit is contained in:
jeefo 2024-05-22 11:13:52 +03:00
commit ee964e0c9a
No known key found for this signature in database
GPG key ID: D696786B81B667C8
14 changed files with 322 additions and 188 deletions

View file

@ -90,6 +90,9 @@ void Game::levelInitialize (edict_t *entities, int max) {
// set the global timer function
timerStorage.setTimeAddress (&globals->time);
// reset timer
fakeping.restartTimer ();
// go thru the all entities on map, and do whatever we're want
for (int i = 0; i < max; ++i) {
auto ent = entities + i;
@ -1007,9 +1010,6 @@ void Game::slowFrame () {
// refresh bomb origin in case some plugin moved it out
graph.setBombOrigin ();
// update client pings
util.calculatePings ();
// update next update time
m_halfSecondFrame = nextUpdate * 0.25f + time ();
}
@ -1049,6 +1049,9 @@ void Game::slowFrame () {
// refresh bot infection (creature) status
bots.refreshCreatureStatus ();
// update client pings
fakeping.calculate ();
// update next update time
m_oneSecondFrame = nextUpdate + time ();
}