From 28b97486cdbc9a4946e23ce979eb2f68b3c5f950 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 11 Dec 2022 14:41:27 +1100 Subject: [PATCH] - SW: For single player games, call `PlayerDeathReset()` from `TerminateLevel()` and not `DoPlayerDeathCheckKeys()`. * This fixes issues where player stats like health, etc are shown onscreen as reset before the entire view reloads. --- source/games/sw/src/game.cpp | 2 ++ source/games/sw/src/player.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index 82ef5482e..4a2d90fe4 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -580,6 +580,8 @@ void TerminateLevel(void) { PLAYER* pp = &Player[pnum]; + PlayerDeathReset(pp); + // Free panel sprites for players pClearSpriteList(pp); diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index cd5c23df4..57176ecc3 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -6026,7 +6026,6 @@ void DoPlayerDeathCheckKeys(PLAYER* pp) plActor->spr.scale = DVector2(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_YREPEAT); plActor->user.ID = NINJA_RUN_R0; - PlayerDeathReset(pp); if (pp == Player + screenpeek) { @@ -6040,6 +6039,8 @@ void DoPlayerDeathCheckKeys(PLAYER* pp) if (numplayers > 1) { + PlayerDeathReset(pp); + // need to call this routine BEFORE resetting DEATH flag DoPlayerBeginRun(pp); }