diff --git a/src/g_game.c b/src/g_game.c index adf86476b..1b6beb96c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2056,18 +2056,22 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) /* Focus our target view first so that we don't take its player. */ (*displayplayerp) = playernum; - if ((*displayplayerp) != olddisplayplayer) - { - G_FixCamera(viewnum); - } + /* If a viewpoint changes, reset the camera to clear uninitialized memory. */ if (viewnum > splits) { - for (viewd = splits+1; viewd < viewnum; ++viewd) + for (viewd = splits+1; viewd <= viewnum; ++viewd) { G_FixCamera(viewd); } } + else + { + if ((*displayplayerp) != olddisplayplayer) + { + G_FixCamera(viewnum); + } + } if (viewnum == 1 && demo.playback) consoleplayer = displayplayers[0]; diff --git a/src/p_tick.c b/src/p_tick.c index 5edb29f80..7405792d0 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -683,8 +683,10 @@ void P_Ticker(boolean run) { player_t *player = &players[displayplayers[i]]; boolean isSkyVisibleForPlayer = skyVisiblePerPlayer[i]; + if (!player->mo) continue; + if (isSkyVisibleForPlayer && skyboxmo[0] && cv_skybox.value) { R_SkyboxFrame(player); @@ -698,8 +700,6 @@ void P_Ticker(boolean run) if (demo.playback) G_StoreRewindInfo(); - -// Z_CheckMemCleanup(); } // Abbreviated ticker for pre-loading, calls thinkers and assorted things