demo: fix hidden ammo counter while demo plays in NG+

Resolves #1559.
This commit is contained in:
walkawayy 2024-10-29 20:39:16 -04:00 committed by Marcin Kurczewski
parent f8efbc9005
commit 393ffcb540
3 changed files with 24 additions and 0 deletions

View file

@ -18,6 +18,7 @@
- fixed Lara reloading the harpoon gun after every shot in NG+ (#1575)
- 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)
## [0.5](https://github.com/LostArtefacts/TRX/compare/afaf12a...tr2-0.5) - 2024-10-08
- added `/sfx` command

View file

@ -31,6 +31,7 @@ decompilation process. We recognize that there is much work to be done.
- fixed Lara reloading the harpoon gun after every shot in NG+
- 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+
#### Visuals

View file

@ -12,10 +12,28 @@
#include "global/funcs.h"
#include "global/vars.h"
static struct {
bool bonus_flag;
} m_OldConfig;
static int32_t m_DemoLevel = 0;
static int32_t m_DemoLevel2 = 0;
static int32_t m_OldDemoInputDB = 0;
static void M_PrepareConfig(void);
static void M_RestoreConfig(void);
static void M_PrepareConfig(void)
{
m_OldConfig.bonus_flag = g_SaveGame.bonus_flag;
g_SaveGame.bonus_flag = false;
}
static void M_RestoreConfig(void)
{
g_SaveGame.bonus_flag = m_OldConfig.bonus_flag;
}
int32_t __cdecl Demo_Control(int32_t level_num)
{
if (level_num < 0 && !g_GameFlow.num_demos) {
@ -41,6 +59,8 @@ int32_t __cdecl Demo_Start(int32_t level_num)
return GFD_EXIT_TO_TITLE;
}
M_PrepareConfig();
if (level_num >= 0) {
m_DemoLevel2 = level_num;
} else {
@ -91,6 +111,8 @@ int32_t __cdecl Demo_Start(int32_t level_num)
Text_Remove(text);
M_RestoreConfig();
*s = start;
S_FadeToBlack();
if (dir == GFD_OVERRIDE) {