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 1a3fad5 commit 7ffc3fc
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 @@ -63,6 +63,7 @@
- fixed enemies that are run over by the skidoo not being counted in the statistics (#1772)
- fixed sound settings resuming the music (#1707)
- fixed the inventory ring spinout animation sometimes running too fast (#1704, regression from 0.3)
- 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 @@ -36,6 +36,7 @@ decompilation process. We recognize that there is much work to be done.
- fixed a crash when firing grenades at Xian guards in statue form
- fixed harpoon bolts damaging inactive enemies
- fixed the distorted skybox in room 5 of Barkhang Monastery
- fixed new saves not displaying the save count in the passport

#### Cheats
- added a fly cheat
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 7ffc3fc

Please sign in to comment.