From a84eed162d0a91f508cd498c55808aa3963a8ba5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 29 Mar 2017 18:25:09 -0400 Subject: [PATCH 1/9] Save mode Lets modders set how the game should be saved. Likely useless for vanilla, but helpful for other mods. This was spawned out of selfishness for SUGOI to make it only save at the hub, but mods like Boss Mayhem, which has a hidden map and an act 3 (without any other acts) in the normal SP campaign, and other mods where the default is detrimental would benefit as well. 0 for default, 1 for always, 2 for never (no constants because bonustype doesn't have them either). Won't save if the game is modified, if using a no-save slot, if playing ultimate mode, or if in a special stage, even if savemode is set to always. --- src/dehacked.c | 12 ++++++++++++ src/doomstat.h | 1 + src/lua_maplib.c | 2 ++ src/p_setup.c | 7 ++++--- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index cc3f196a6..f56726c44 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1339,7 +1339,19 @@ static void readlevelheader(MYFILE *f, INT32 num) else deh_warning("Level header %d: invalid bonus type number %d", num, i); } + + else if (fastcmp(word, "SAVEMODE")) + { + if (fastcmp(word2, "DEFAULT")) i = 0; + else if (fastcmp(word2, "ALWAYS")) i = 1; + else if (fastcmp(word2, "NEVER")) i = 2; + if (i >= 0 && i <= 2) + mapheaderinfo[num-1]->savemode = (UINT8)i; + else + deh_warning("Level header %d: invalid save mode number %d", num, i); + } + else if (fastcmp(word, "LEVELFLAGS")) mapheaderinfo[num-1]->levelflags = (UINT8)i; else if (fastcmp(word, "MENUFLAGS")) diff --git a/src/doomstat.h b/src/doomstat.h index f1b7d2169..29ba7e13c 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -237,6 +237,7 @@ typedef struct SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.) + UINT8 savemode; ///< Handles whenever or not the game should save at a level. (0 = default, 1 = always, 2 = never) UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus diff --git a/src/lua_maplib.c b/src/lua_maplib.c index f1bfcb8f1..d61342435 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1784,6 +1784,8 @@ static int mapheaderinfo_get(lua_State *L) lua_pushinteger(L, header->levelselect); else if (fastcmp(field,"bonustype")) lua_pushinteger(L, header->bonustype); + else if (fastcmp(field,"savemode")) + lua_pushinteger(L, header->savemode); else if (fastcmp(field,"levelflags")) lua_pushinteger(L, header->levelflags); else if (fastcmp(field,"menuflags")) diff --git a/src/p_setup.c b/src/p_setup.c index 6df103255..023c6fdf3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -246,6 +246,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->levelselect = 0; DEH_WriteUndoline("BONUSTYPE", va("%d", mapheaderinfo[num]->bonustype), UNDO_NONE); mapheaderinfo[num]->bonustype = 0; + DEH_WriteUndoline("SAVEMODE", va("%d", mapheaderinfo[num]->savemode), UNDO_NONE); + mapheaderinfo[num]->savemode = 0; DEH_WriteUndoline("LEVELFLAGS", va("%d", mapheaderinfo[num]->levelflags), UNDO_NONE); mapheaderinfo[num]->levelflags = 0; DEH_WriteUndoline("MENUFLAGS", va("%d", mapheaderinfo[num]->menuflags), UNDO_NONE); @@ -2960,9 +2962,8 @@ boolean P_SetupLevel(boolean skipprecip) P_RunCachedActions(); if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0) - && (!modifiedgame || savemoddata) && cursaveslot >= 0 && !ultimatemode - && !(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) - && (!G_IsSpecialStage(gamemap)) && gamemap != lastmapsaved && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete)) + && (!modifiedgame || savemoddata) && cursaveslot >= 0 && !ultimatemode && !(G_IsSpecialStage(gamemap)) && !(mapheaderinfo[gamemap-1]->savemode == 2) + && ((mapheaderinfo[gamemap-1]->savemode == 1) || (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && gamemap != lastmapsaved && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete)))) G_SaveGame((UINT32)cursaveslot); if (savedata.lives > 0) From 9d17466d99d53340e042dd871869bd196a4ac09b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 3 Aug 2017 20:27:31 -0400 Subject: [PATCH 2/9] Added lastmaploaded to replace the lastmapsaved check This allows saving in special cases where you can go to a map that doesn't save, and then back to the map you saved on (see: SUBARASHII special stages), while still preventing you from killing your lives by repeatedly retrying in said map. Kept lastmapsaved just in case. Can be removed if deemed unnecessary. --- src/d_main.c | 3 ++- src/doomstat.h | 1 + src/g_game.c | 1 + src/p_saveg.c | 6 ++++-- src/p_setup.c | 8 +++++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 1a58ee89a..9702eda1b 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -709,7 +709,8 @@ void D_StartTitle(void) botskin = 0; cv_debug = 0; emeralds = 0; - + lastmaploaded = 0; + // In case someone exits out at the same time they start a time attack run, // reset modeattacking modeattacking = ATTACKING_NONE; diff --git a/src/doomstat.h b/src/doomstat.h index 5e99a5978..8eec860c3 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -42,6 +42,7 @@ extern UINT8 globalweather; extern INT32 curWeather; extern INT32 cursaveslot; extern INT16 lastmapsaved; +extern INT16 lastmaploaded; extern boolean gamecomplete; #define PRECIP_NONE 0 diff --git a/src/g_game.c b/src/g_game.c index 7769555ba..1923be04a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -78,6 +78,7 @@ UINT8 globalweather = 0; INT32 curWeather = PRECIP_NONE; INT32 cursaveslot = -1; // Auto-save 1p savegame slot INT16 lastmapsaved = 0; // Last map we auto-saved at +INT16 lastmaploaded = 0; // Last map the game loaded boolean gamecomplete = false; UINT16 mainwads = 0; diff --git a/src/p_saveg.c b/src/p_saveg.c index 3853dc7e6..f09e0163e 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3160,7 +3160,8 @@ static inline void P_ArchiveMisc(void) WRITEINT16(save_p, gamemap); lastmapsaved = gamemap; - + lastmaploaded = gamemap; + WRITEUINT16(save_p, (botskin ? (emeralds|(1<<10)) : emeralds)+357); WRITESTRINGN(save_p, timeattackfolder, sizeof(timeattackfolder)); } @@ -3185,7 +3186,8 @@ static inline void P_UnArchiveSPGame(INT16 mapoverride) P_AllocMapHeader(gamemap-1); lastmapsaved = gamemap; - + lastmaploaded = gamemap; + tokenlist = 0; token = 0; diff --git a/src/p_setup.c b/src/p_setup.c index ad737f3d5..b8491d67b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2984,10 +2984,12 @@ boolean P_SetupLevel(boolean skipprecip) P_RunCachedActions(); if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0) - && (!modifiedgame || savemoddata) && cursaveslot >= 0 && !ultimatemode && !(G_IsSpecialStage(gamemap)) && !(mapheaderinfo[gamemap-1]->savemode == 2) - && ((mapheaderinfo[gamemap-1]->savemode == 1) || (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && gamemap != lastmapsaved && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete)))) + && (!modifiedgame || savemoddata) && cursaveslot >= 0 && !ultimatemode && !(G_IsSpecialStage(gamemap)) && (gamemap != lastmaploaded) && !(mapheaderinfo[gamemap-1]->savemode == 2) + && ((mapheaderinfo[gamemap-1]->savemode == 1) || (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete)))) G_SaveGame((UINT32)cursaveslot); + lastmaploaded = gamemap; // HAS to be set after saving!! + if (savedata.lives > 0) { players[consoleplayer].continues = savedata.continues; @@ -3014,7 +3016,7 @@ boolean P_SetupLevel(boolean skipprecip) LUAh_MapLoad(); #endif } - + return true; } From 2d9a024c4a2c57db101ea1e19bb7bd8632802224 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 4 Aug 2017 13:57:47 -0400 Subject: [PATCH 3/9] Commenting out lastmapsaved --- src/doomstat.h | 2 +- src/g_game.c | 2 +- src/m_menu.c | 2 +- src/p_saveg.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 8eec860c3..992d39a45 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -41,7 +41,7 @@ extern INT16 maptol; extern UINT8 globalweather; extern INT32 curWeather; extern INT32 cursaveslot; -extern INT16 lastmapsaved; +//extern INT16 lastmapsaved; extern INT16 lastmaploaded; extern boolean gamecomplete; diff --git a/src/g_game.c b/src/g_game.c index 1923be04a..1a2a2aac6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -77,7 +77,7 @@ INT16 maptol; UINT8 globalweather = 0; INT32 curWeather = PRECIP_NONE; INT32 cursaveslot = -1; // Auto-save 1p savegame slot -INT16 lastmapsaved = 0; // Last map we auto-saved at +//INT16 lastmapsaved = 0; // Last map we auto-saved at INT16 lastmaploaded = 0; // Last map the game loaded boolean gamecomplete = false; diff --git a/src/m_menu.c b/src/m_menu.c index b7f9e8802..c49d7c023 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6111,7 +6111,7 @@ static void M_ChoosePlayer(INT32 choice) if (startmap != spstage_start) cursaveslot = -1; - lastmapsaved = 0; + //lastmapsaved = 0; gamecomplete = false; G_DeferedInitNew(ultmode, G_BuildMapName(startmap), (UINT8)skinnum, false, fromlevelselect); diff --git a/src/p_saveg.c b/src/p_saveg.c index f09e0163e..b065a02e0 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3159,7 +3159,7 @@ static inline void P_ArchiveMisc(void) else WRITEINT16(save_p, gamemap); - lastmapsaved = gamemap; + //lastmapsaved = gamemap; lastmaploaded = gamemap; WRITEUINT16(save_p, (botskin ? (emeralds|(1<<10)) : emeralds)+357); @@ -3185,7 +3185,7 @@ static inline void P_UnArchiveSPGame(INT16 mapoverride) if(!mapheaderinfo[gamemap-1]) P_AllocMapHeader(gamemap-1); - lastmapsaved = gamemap; + //lastmapsaved = gamemap; lastmaploaded = gamemap; tokenlist = 0; From 0270e50ce575c14d93984b81b86e7a1856e562a6 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 4 Aug 2017 20:43:00 +0100 Subject: [PATCH 4/9] Split off mostly map-specific code into a "CanSaveLevel" function, just to make things a bit less cluttered --- src/p_setup.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index b8491d67b..3584b6975 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2534,6 +2534,31 @@ static void P_LoadNightsGhosts(void) free(gpath); } +static boolean CanSaveLevel(INT32 mapnum) +{ + if (ultimatemode) // never save in ultimate (probably redundant with cursaveslot also being checked) + return false; + + if (G_IsSpecialStage(mapnum) // don't save in special stages + || mapnum == lastmaploaded) // don't save if the last map loaded was this one + return false; + + // Determine whether the map should save or not from map header's "savemode" option + switch (mapheaderinfo[mapnum-1]->savemode) { + case 1: return true; // ALWAYS - always save, override conditions below + case 2: return false; // NEVER - never save + default: break; // DEFAULT - just do whatever's normal for this kind of map + } + + // Don't save if Hidden = 1 is set in map header + if (mapheaderinfo[mapnum-1]->menuflags & LF2_HIDEINMENU) + return false; + + // Only act 1 levels (or levels with no act number) can save normally. + // If the game is complete for this save slot, any level can save! + return (mapheaderinfo[mapnum-1]->actnum < 2 || gamecomplete); +} + /** Loads a level from a lump or external wad. * * \param skipprecip If true, don't spawn precipitation. @@ -2983,9 +3008,8 @@ boolean P_SetupLevel(boolean skipprecip) P_RunCachedActions(); - if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0) - && (!modifiedgame || savemoddata) && cursaveslot >= 0 && !ultimatemode && !(G_IsSpecialStage(gamemap)) && (gamemap != lastmaploaded) && !(mapheaderinfo[gamemap-1]->savemode == 2) - && ((mapheaderinfo[gamemap-1]->savemode == 1) || (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete)))) + if (!(netgame || multiplayer|| demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0) + && (!modifiedgame || savemoddata) && cursaveslot >= 0 && CanSaveLevel(gamemap)) G_SaveGame((UINT32)cursaveslot); lastmaploaded = gamemap; // HAS to be set after saving!! From 157c5625d75cb7db44a8fe106ce4472cc108ba0e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 4 Aug 2017 22:22:20 +0100 Subject: [PATCH 5/9] Welp, that space removal was my fault --- src/p_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index 3584b6975..7e4695320 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3008,7 +3008,7 @@ boolean P_SetupLevel(boolean skipprecip) P_RunCachedActions(); - if (!(netgame || multiplayer|| demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0) + if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0) && (!modifiedgame || savemoddata) && cursaveslot >= 0 && CanSaveLevel(gamemap)) G_SaveGame((UINT32)cursaveslot); From a5ca15862256a96bdadcd8ebc8e07c7800bbf17e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 6 Aug 2017 16:36:55 -0400 Subject: [PATCH 6/9] LF_SAVEGAME flag instead of savemode Also always save on file creation --- src/dehacked.c | 21 ++++++++------------- src/doomstat.h | 1 + src/p_setup.c | 22 +++++----------------- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index e8fb48763..a00488ccf 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1288,18 +1288,6 @@ static void readlevelheader(MYFILE *f, INT32 num) deh_warning("Level header %d: invalid bonus type number %d", num, i); } - else if (fastcmp(word, "SAVEMODE")) - { - if (fastcmp(word2, "DEFAULT")) i = 0; - else if (fastcmp(word2, "ALWAYS")) i = 1; - else if (fastcmp(word2, "NEVER")) i = 2; - - if (i >= 0 && i <= 2) - mapheaderinfo[num-1]->savemode = (UINT8)i; - else - deh_warning("Level header %d: invalid save mode number %d", num, i); - } - else if (fastcmp(word, "LEVELFLAGS")) mapheaderinfo[num-1]->levelflags = (UINT8)i; else if (fastcmp(word, "MENUFLAGS")) @@ -1341,7 +1329,14 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE; } - + else if (fastcmp(word, "SAVEGAME")) + { + if (i || word2[0] == 'T' || word2[0] == 'Y') + mapheaderinfo[num-1]->levelflags |= LF_SAVEGAME; + else + mapheaderinfo[num-1]->levelflags &= ~LF_SAVEGAME; + } + // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) { diff --git a/src/doomstat.h b/src/doomstat.h index 992d39a45..93678b9b0 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -265,6 +265,7 @@ typedef struct #define LF_NOSSMUSIC 4 ///< Disable Super Sonic music #define LF_NORELOAD 8 ///< Don't reload level on death #define LF_NOZONE 16 ///< Don't include "ZONE" on level title +#define LF_SAVEGAME 32 ///< Save the game upon loading this level #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/p_setup.c b/src/p_setup.c index e89d34b9e..5ba5ae2ab 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -250,8 +250,6 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->levelselect = 0; DEH_WriteUndoline("BONUSTYPE", va("%d", mapheaderinfo[num]->bonustype), UNDO_NONE); mapheaderinfo[num]->bonustype = 0; - DEH_WriteUndoline("SAVEMODE", va("%d", mapheaderinfo[num]->savemode), UNDO_NONE); - mapheaderinfo[num]->savemode = 0; DEH_WriteUndoline("LEVELFLAGS", va("%d", mapheaderinfo[num]->levelflags), UNDO_NONE); mapheaderinfo[num]->levelflags = 0; DEH_WriteUndoline("MENUFLAGS", va("%d", mapheaderinfo[num]->menuflags), UNDO_NONE); @@ -2557,21 +2555,11 @@ static boolean CanSaveLevel(INT32 mapnum) if (G_IsSpecialStage(mapnum) // don't save in special stages || mapnum == lastmaploaded) // don't save if the last map loaded was this one return false; - - // Determine whether the map should save or not from map header's "savemode" option - switch (mapheaderinfo[mapnum-1]->savemode) { - case 1: return true; // ALWAYS - always save, override conditions below - case 2: return false; // NEVER - never save - default: break; // DEFAULT - just do whatever's normal for this kind of map - } - - // Don't save if Hidden = 1 is set in map header - if (mapheaderinfo[mapnum-1]->menuflags & LF2_HIDEINMENU) - return false; - - // Only act 1 levels (or levels with no act number) can save normally. - // If the game is complete for this save slot, any level can save! - return (mapheaderinfo[mapnum-1]->actnum < 2 || gamecomplete); + + // Any levels that have the savegame flag can save normally. + // If the game is complete for this save slot, then any level can save! + // On the other side of the spectrum, if lastmaploaded is 0, then the save file has only just been created and needs to save ASAP! + return (mapheaderinfo[mapnum-1]->levelflags & LF_SAVEGAME || gamecomplete || !lastmaploaded); } /** Loads a level from a lump or external wad. From 5c1aaf3906a5d4b28f1891e40b3e732f4e8a7e41 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 6 Aug 2017 17:07:23 -0400 Subject: [PATCH 7/9] Guess who forgot to press "Save All Files" in Notepad++ ^^; --- src/doomstat.h | 1 - src/lua_maplib.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 93678b9b0..a24bad79d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -238,7 +238,6 @@ typedef struct SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.) - UINT8 savemode; ///< Handles whenever or not the game should save at a level. (0 = default, 1 = always, 2 = never) UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus diff --git a/src/lua_maplib.c b/src/lua_maplib.c index d61342435..f1bfcb8f1 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1784,8 +1784,6 @@ static int mapheaderinfo_get(lua_State *L) lua_pushinteger(L, header->levelselect); else if (fastcmp(field,"bonustype")) lua_pushinteger(L, header->bonustype); - else if (fastcmp(field,"savemode")) - lua_pushinteger(L, header->savemode); else if (fastcmp(field,"levelflags")) lua_pushinteger(L, header->levelflags); else if (fastcmp(field,"menuflags")) From 042729bd8fd6eafdef109dbfc8821c69906acd7b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 6 Aug 2017 17:09:25 -0400 Subject: [PATCH 8/9] AA i'm forgetting everything today --- src/dehacked.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dehacked.c b/src/dehacked.c index a00488ccf..ccdd74c14 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7050,6 +7050,7 @@ struct { {"LF_NOSSMUSIC",LF_NOSSMUSIC}, {"LF_NORELOAD",LF_NORELOAD}, {"LF_NOZONE",LF_NOZONE}, + {"LF_SAVEGAME",LF_SAVEGAME}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, From a813506b8f1bcbd3ee31eb9aed187f5b1d5db1bc Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 6 Aug 2017 23:47:39 -0400 Subject: [PATCH 9/9] Clean whitespace --- src/d_main.c | 2 +- src/dehacked.c | 4 ++-- src/p_saveg.c | 4 ++-- src/p_setup.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 4ba277d4d..89d530890 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -713,7 +713,7 @@ void D_StartTitle(void) cv_debug = 0; emeralds = 0; lastmaploaded = 0; - + // In case someone exits out at the same time they start a time attack run, // reset modeattacking modeattacking = ATTACKING_NONE; diff --git a/src/dehacked.c b/src/dehacked.c index ccdd74c14..814f7d65a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1287,7 +1287,7 @@ static void readlevelheader(MYFILE *f, INT32 num) else deh_warning("Level header %d: invalid bonus type number %d", num, i); } - + else if (fastcmp(word, "LEVELFLAGS")) mapheaderinfo[num-1]->levelflags = (UINT8)i; else if (fastcmp(word, "MENUFLAGS")) @@ -1336,7 +1336,7 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_SAVEGAME; } - + // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) { diff --git a/src/p_saveg.c b/src/p_saveg.c index b065a02e0..2d3412e65 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3161,7 +3161,7 @@ static inline void P_ArchiveMisc(void) //lastmapsaved = gamemap; lastmaploaded = gamemap; - + WRITEUINT16(save_p, (botskin ? (emeralds|(1<<10)) : emeralds)+357); WRITESTRINGN(save_p, timeattackfolder, sizeof(timeattackfolder)); } @@ -3187,7 +3187,7 @@ static inline void P_UnArchiveSPGame(INT16 mapoverride) //lastmapsaved = gamemap; lastmaploaded = gamemap; - + tokenlist = 0; token = 0; diff --git a/src/p_setup.c b/src/p_setup.c index 5ba5ae2ab..03b133da2 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3016,7 +3016,7 @@ boolean P_SetupLevel(boolean skipprecip) G_SaveGame((UINT32)cursaveslot); lastmaploaded = gamemap; // HAS to be set after saving!! - + if (savedata.lives > 0) { players[consoleplayer].continues = savedata.continues; @@ -3043,7 +3043,7 @@ boolean P_SetupLevel(boolean skipprecip) LUAh_MapLoad(); #endif } - + return true; }