game: fix new saves not having a save count in the passport (#1829)

Resolves #1591.

Eventually this fix will be moved to S_SaveGame.
This commit is contained in:
walkawayy 2024-11-05 11:57:06 -05:00 committed by GitHub
parent 1a3fad5c2a
commit 4795f7e07e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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;
}