Fixed startpos not saving

Will now load properly from a save game preventing respawning at the wrong player starts.
This commit is contained in:
Boondorl 2024-11-03 20:40:37 -05:00 committed by Rachael Alexanderson
commit 0fe2d72b75
2 changed files with 16 additions and 8 deletions

View file

@ -96,6 +96,8 @@
static FRandom pr_dmspawn ("DMSpawn");
static FRandom pr_pspawn ("PlayerSpawn");
extern int startpos, laststartpos;
bool WriteZip(const char* filename, const FileSys::FCompressedBuffer* content, size_t contentcount);
bool G_CheckDemoStatus (void);
void G_ReadDemoTiccmd (ticcmd_t *cmd, int player);
@ -2146,7 +2148,9 @@ void G_DoLoadGame ()
arc("ticrate", time[0])
("leveltime", time[1])
("globalfreeze", globalfreeze);
("globalfreeze", globalfreeze)
("startpos", startpos)
("laststartpos", laststartpos);
// dearchive all the modifications
level.time = Scale(time[1], TICRATE, time[0]);
@ -2434,6 +2438,10 @@ void G_DoSaveGame (bool okForQuicksave, bool forceQuicksave, FString filename, c
savegameglobals("leveltime", level.time);
}
savegameglobals("globalfreeze", globalfreeze)
("startpos", startpos)
("laststartpos", laststartpos);
STAT_Serialize(savegameglobals);
FRandom::StaticWriteRNGState(savegameglobals);
P_WriteACSDefereds(savegameglobals);