Skip to content

Commit

Permalink
game: fix new saves not having a save count in the passport (LostArte…
Browse files Browse the repository at this point in the history
…facts#1829)

Resolves LostArtefacts#1591.

Eventually this fix will be moved to S_SaveGame.
  • Loading branch information
walkawayy authored Nov 5, 2024
1 parent 1a3fad5 commit 4795f7e
Show file tree
Hide file tree
Showing 4 changed files with 13 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
3 changes: 3 additions & 0 deletions src/tr2/game/savegame/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ bool Savegame_Save(const int32_t slot_idx)
{
CreateSaveGameInfo();
S_SaveGame(&g_SaveGame, sizeof(SAVEGAME_INFO), slot_idx);
// TODO: move me inside S_SaveGame
g_SaveGameReqFlags1[slot_idx] = g_RequesterFlags1[slot_idx];
g_SaveGameReqFlags2[slot_idx] = g_RequesterFlags2[slot_idx];
GetSavedGamesList(&g_LoadGameRequester);
return true;
}

0 comments on commit 4795f7e

Please sign in to comment.