From 1dc4bc6de83a9c7b4e17133e356ce085f3fd4263 Mon Sep 17 00:00:00 2001 From: walkawayy <81546780+walkawayy@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:27:24 -0500 Subject: [PATCH] game: fix new saves not having the save count in the passport Resolves #1591. Eventually this fix will be moved to S_SaveGame. --- docs/tr2/CHANGELOG.md | 1 + docs/tr2/README.md | 1 + src/tr2/game/game.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index d2f99b4fe..7c605ce0d 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -61,6 +61,7 @@ - fixed harpoon bolts damaging inactive enemies (#1804) - fixed enemies that are run over by the skidoo not being counted in the statistics (#1772) - fixed sound settings resuming the music (#1707) +- fixed new saves not displaying the save count in the passport (#1591) ## [0.5](https://github.com/LostArtefacts/TRX/compare/afaf12a...tr2-0.5) - 2024-10-08 - added `/sfx` command diff --git a/docs/tr2/README.md b/docs/tr2/README.md index e22e02655..398ea98fa 100644 --- a/docs/tr2/README.md +++ b/docs/tr2/README.md @@ -35,6 +35,7 @@ decompilation process. We recognize that there is much work to be done. - fixed the game hanging if exited during the level stats, credits, or final stats - fixed a crash when firing grenades at Xian guards in statue form - fixed harpoon bolts damaging inactive enemies +- fixed new saves not displaying the save count in the passport #### Statistics - fixed the dragon counting as more than one kill if allowed to revive diff --git a/src/tr2/game/game.c b/src/tr2/game/game.c index cb4a8cd5d..74a28b297 100644 --- a/src/tr2/game/game.c +++ b/src/tr2/game/game.c @@ -123,9 +123,15 @@ int32_t __cdecl Game_Control(int32_t nframes, const bool demo_mode) return GFD_START_GAME | LV_FIRST; } CreateSaveGameInfo(); + const int16_t slot_num = g_Inv_ExtraData[1]; S_SaveGame( - &g_SaveGame, sizeof(SAVEGAME_INFO), - g_Inv_ExtraData[1]); + &g_SaveGame, sizeof(SAVEGAME_INFO), slot_num); + // TODO: move me inside S_SaveGame + g_SaveGameReqFlags1[slot_num] = + g_RequesterFlags1[slot_num]; + g_SaveGameReqFlags2[slot_num] = + g_RequesterFlags2[slot_num]; + S_SaveSettings(); } else { return dir;