Skip to content

Commit

Permalink
game: fix new saves not having the save count in the passport
Browse files Browse the repository at this point in the history
Resolves LostArtefacts#1591.

Eventually this fix will be moved to S_SaveGame.
  • Loading branch information
walkawayy committed Nov 5, 2024
1 parent 0953a0b commit 1dc4bc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/tr2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/tr2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/tr2/game/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1dc4bc6

Please sign in to comment.