Fixed quick save rotator breaking save logic

The game should only ever save during the gameplay loop and never on the spot. Also fixes the quick save rotator skipping certain checks.
This commit is contained in:
Boondorl 2025-07-28 00:06:08 -04:00 committed by Rachael Alexanderson
commit a4ed63033e
6 changed files with 30 additions and 7 deletions

View file

@ -1196,6 +1196,12 @@ void G_Ticker ()
savegamefile = "";
savedescription = "";
break;
case ga_quicksave:
G_DoSaveGame(true, true, savegamefile, savedescription.GetChars());
gameaction = ga_nothing;
savegamefile = "";
savedescription = "";
break;
case ga_autosave:
G_DoAutoSave ();
gameaction = ga_nothing;
@ -2145,9 +2151,9 @@ void G_DoLoadGame ()
// Called by the menu task.
// Description is a 24 byte text string
//
void G_SaveGame (const char *filename, const char *description)
void G_SaveGame (const char *filename, const char *description, bool quick)
{
if (sendsave || gameaction == ga_savegame)
if (sendsave || gameaction == ga_savegame || gameaction == ga_quicksave)
{
Printf ("%s\n", GStrings.GetString("TXT_SAVEPENDING"));
}
@ -2171,7 +2177,17 @@ void G_SaveGame (const char *filename, const char *description)
{
savegamefile = filename;
savedescription = description;
sendsave = true;
if (quick)
{
sendsave = false;
gameaction = ga_quicksave;
}
else
{
sendsave = true;
if (gameaction == ga_quicksave)
gameaction = ga_nothing;
}
}
}
@ -2268,7 +2284,7 @@ void G_DoQuickSave ()
readableTime = myasctime ();
description.Format("Quicksave %s", readableTime);
G_DoSaveGame (true, true, file, description.GetChars());
G_SaveGame(file.GetChars(), description.GetChars(), true);
}