only set quicksaveslot upon successful load/save completion (#1085)

Fixes #1083
This commit is contained in:
Fabian Greffrath 2023-05-29 12:26:45 +02:00 committed by GitHub
parent a2c40bbd2a
commit 411f934292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -2017,6 +2017,8 @@ static void G_DoSaveGame(void)
savedescription[0] = 0;
if (name) free(name);
M_SetQuickSaveSlot(savegameslot);
}
static void G_DoLoadGame(void)
@ -2217,6 +2219,8 @@ static void G_DoLoadGame(void)
fprintf(stderr, "G_DoLoadGame: Slot %d, %.8s (%s)\n",
10*savepage+savegameslot, maplump, W_WadNameForLump(maplumpnum));
}
M_SetQuickSaveSlot(savegameslot);
}
boolean clean_screenshot;

View File

@ -89,7 +89,7 @@ int screenblocks; // has default
int screenSize; // temp for screenblocks (0-9)
int quickSaveSlot; // -1 = no quicksave slot picked!
static int quickSaveSlot; // -1 = no quicksave slot picked!
int messageToPrint; // 1 = message to be printed
@ -938,10 +938,6 @@ void M_LoadSelect(int choice)
M_ClearMenus ();
if (name) free(name);
// [crispy] allow quickload before quicksave
if (quickSaveSlot == -2)
quickSaveSlot = choice;
// [crispy] save the last game you loaded
SaveDef.lastOn = choice;
}
@ -1106,8 +1102,10 @@ void M_DoSave(int slot)
{
G_SaveGame (slot,savegamestrings[slot]);
M_ClearMenus ();
}
// PICK QUICKSAVE SLOT YET?
void M_SetQuickSaveSlot (int slot)
{
if (quickSaveSlot == -2)
quickSaveSlot = slot;
}

View File

@ -188,6 +188,8 @@ typedef enum
extern background_t menu_background;
extern boolean M_MenuIsShaded(void);
extern void M_SetQuickSaveSlot (int slot);
#define MAX_MIDI_PLAYER_MENU_ITEMS 128
extern void M_GetMidiDevices(void);