From 494e556f5feba3f94e8296091ecb4d5a2a332c0d Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 18 Feb 2022 08:13:26 +0100 Subject: [PATCH] always append WAD file name to savegame namess, even for IWADs Why the inconsistency? --- Source/m_menu.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/Source/m_menu.c b/Source/m_menu.c index 9233d9e7..3bd0210c 100644 --- a/Source/m_menu.c +++ b/Source/m_menu.c @@ -1056,29 +1056,19 @@ void M_DoSave(int slot) // [FG] generate a default save slot name when the user saves to an empty slot static void SetDefaultSaveName (int slot) { - // map from IWAD or PWAD? - if (W_IsIWADLump(maplumpnum)) - { - M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE, - "%s", lumpinfo[maplumpnum].name); - } - else - { - char *wadname = M_StringDuplicate(W_WadNameForLump(maplumpnum)); - char *ext = strrchr(wadname, '.'); + char *wadname = M_StringDuplicate(W_WadNameForLump(maplumpnum)); + char *ext = strrchr(wadname, '.'); - if (ext != NULL) - { - *ext = '\0'; - } - - M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE, - "%s (%s)", lumpinfo[maplumpnum].name, - wadname); - (free)(wadname); + if (ext != NULL) + { + *ext = '\0'; } - M_ForceUppercase(savegamestrings[itemOn]); + M_snprintf(savegamestrings[slot], SAVESTRINGSIZE, + "%s (%s)", lumpinfo[maplumpnum].name, wadname); + (free)(wadname); + + M_ForceUppercase(savegamestrings[slot]); } // [FG] override savegame name if it already starts with a map identifier @@ -4776,7 +4766,10 @@ boolean M_Responder (event_t* ev) { if (saveCharIndex > 0) { - saveCharIndex--; + if (StartsWithMapIdentifier(savegamestrings[saveSlot])) + saveCharIndex = 0; + else + saveCharIndex--; savegamestrings[saveSlot][saveCharIndex] = 0; } }