- sanitized the 'frozen level' code.

This had two different flags that were checked totally inconsistently, and one was not even saved.
Moved everything into a few subfunctions so that these checks do not have to be scattered all over the code.
This commit is contained in:
Christoph Oelckers 2019-01-28 20:15:48 +01:00
commit 259ae41774
25 changed files with 124 additions and 65 deletions

View file

@ -1219,6 +1219,12 @@ void P_PlayerThink (player_t *player)
I_Error ("No player %td start\n", player - players + 1);
}
// Bots do not think in freeze mode.
if (player->mo->Level->isFrozen() && player->Bot != nullptr)
{
return;
}
if (debugfile && !(player->cheats & CF_PREDICTING))
{
fprintf (debugfile, "tic %d for pl %d: (%f, %f, %f, %f) b:%02x p:%d y:%d f:%d s:%d u:%d\n",
@ -1682,7 +1688,7 @@ bool P_IsPlayerTotallyFrozen(const player_t *player)
return
gamestate == GS_TITLELEVEL ||
player->cheats & CF_TOTALLYFROZEN ||
((player->mo->Level->flags2 & LEVEL2_FROZEN) && player->timefreezer == 0);
player->mo->isFrozen();
}