From 623330f938ad0733bd5f7f9eda8572f5bac8898c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 28 Jan 2019 22:33:50 +0100 Subject: [PATCH] - initial adjustments for P_Ticker. --- src/p_tick.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/p_tick.cpp b/src/p_tick.cpp index 65655b82b..97e8af6a0 100644 --- a/src/p_tick.cpp +++ b/src/p_tick.cpp @@ -62,7 +62,8 @@ bool P_CheckTickerPaused () && players[consoleplayer].viewz != NO_VALUE && wipegamestate == gamestate) { - S_PauseSound (!(level.flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false); + // Only the current UI level's settings are relevant for sound. + S_PauseSound (!(currentUILevel->flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false); return true; } return false; @@ -95,11 +96,15 @@ void P_Ticker (void) DPSprite::NewTick(); // [RH] Frozen mode is only changed every 4 tics, to make it work with A_Tracer(). - if ((level.maptime & 3) == 0) + // This may not be perfect but it is not really relevant for sublevels that tracer homing behavior is preserved. + if ((currentUILevel->maptime & 3) == 0) { if (bglobal.changefreeze) { - level.frozenstate ^= 2; + for (auto Level : AllLevels()) + { + Level->frozenstate ^= 2; + } bglobal.freeze ^= 1; bglobal.changefreeze = 0; } @@ -120,13 +125,16 @@ void P_Ticker (void) P_ResetSightCounters (false); R_ClearInterpolationPath(); - // Reset all actor interpolations for all actors before the current thinking turn so that indirect actor movement gets properly interpolated. - TThinkerIterator it; - AActor *ac; - - while ((ac = it.Next())) + // Reset all actor interpolations on all levels before the current thinking turn so that indirect actor movement gets properly interpolated. + for (auto Level : AllLevels()) { - ac->ClearInterpolation(); + auto it = Level->GetThinkerIterator(); + AActor *ac; + + while ((ac = it.Next())) + { + ac->ClearInterpolation(); + } } // Since things will be moving, it's okay to interpolate them in the renderer.