Add current, max and average velocity as stat (#912)

* Add current, max and average velocity as stat
This commit is contained in:
hdr88 2019-08-28 20:33:07 +02:00 committed by Christoph Oelckers
commit 554eb1c813
4 changed files with 19 additions and 0 deletions

View file

@ -180,5 +180,9 @@ void P_Ticker (void)
Level->maptime++;
Level->totaltime++;
}
if (players[consoleplayer].mo != NULL) {
if (players[consoleplayer].mo->Vel.Length() > primaryLevel->max_velocity) { primaryLevel->max_velocity = players[consoleplayer].mo->Vel.Length(); }
primaryLevel->avg_velocity += (players[consoleplayer].mo->Vel.Length() - primaryLevel->avg_velocity) / primaryLevel->maptime;
}
StatusBar->CallTick(); // Status bar should tick AFTER the thinkers to properly reflect the level's state at this time.
}