stats: fix game hanging if exited during stats or credits

Resolves #1585.
This commit is contained in:
walkawayy 2024-10-29 21:10:25 -04:00 committed by Marcin Kurczewski
parent 393ffcb540
commit 11a7bad3cd
5 changed files with 21 additions and 1 deletions

View file

@ -19,6 +19,7 @@
- fixed the dragon reviving itself after Lara removes the dagger in rare circumstances (#1572)
- fixed grenades counting as double kills in the game statistics (#1560)
- fixed the ammo counter being hidden while a demo plays in NG+ (#1559)
- fixed the game hanging if exited during the level stats, credits, or final stats (#1585)
## [0.5](https://github.com/LostArtefacts/TRX/compare/afaf12a...tr2-0.5) - 2024-10-08
- added `/sfx` command

View file

@ -32,6 +32,7 @@ decompilation process. We recognize that there is much work to be done.
- fixed the dragon reviving itself after Lara removes the dagger in rare circumstances
- fixed grenades counting as double kills in the game statistics
- fixed the ammo counter being hidden while a demo plays in NG+
- fixed the game hanging if exited during the level stats, credits, or final stats
#### Visuals

View file

@ -2816,6 +2816,10 @@ void __cdecl S_Wait(int32_t frames, const BOOL input_check)
passed = Sync();
} while (!passed);
frames -= passed;
if (g_IsGameToExit) {
break;
}
}
}
@ -2830,6 +2834,10 @@ void __cdecl S_Wait(int32_t frames, const BOOL input_check)
passed = Sync();
} while (!passed);
frames -= passed;
if (g_IsGameToExit) {
break;
}
}
}

View file

@ -323,6 +323,10 @@ int32_t __cdecl LevelStats(const int32_t level_num)
Input_Update();
if (g_IsGameToExit) {
break;
}
if (g_GF_OverrideDir != (GAME_FLOW_DIR)-1) {
break;
}
@ -369,6 +373,10 @@ int32_t __cdecl GameStats(const int32_t level_num)
Input_Update();
if (g_IsGameToExit) {
break;
}
if (g_GF_OverrideDir != (GAME_FLOW_DIR)-1) {
break;
}

View file

@ -2,6 +2,7 @@
#include "config.h"
#include "decomp/decomp.h"
#include "game/background.h"
#include "game/console/common.h"
#include "game/demo.h"
#include "game/game_string.h"
@ -169,7 +170,8 @@ void __cdecl Shell_Shutdown(void)
GameString_Shutdown();
Console_Shutdown();
WinInFinish();
RenderFinish(true);
BGND_Free();
RenderFinish(false);
WinVidFinish();
WinVidHideGameWindow();
Text_Shutdown();