diff --git a/src/g_level.cpp b/src/g_level.cpp index e6b8bad91..32acf14cb 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -737,7 +737,14 @@ void G_DoCompleted (void) if (mode == FINISH_SameHub) { // Remember the level's state for re-entry. - G_SnapshotLevel (); + if (!(level.flags2 & LEVEL2_FORGETSTATE)) + { + G_SnapshotLevel (); + } + else + { // Make sure we don't have a snapshot lying around from before. + level.info->ClearSnapshot(); + } } else { // Forget the states of all existing levels. diff --git a/src/g_level.h b/src/g_level.h index c246e5b7e..488cb3eaf 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -213,6 +213,7 @@ enum ELevelFlags LEVEL2_NOSTATISTICS = 0x10000000, // This level should not have statistics collected LEVEL2_ENDGAME = 0x20000000, // This is an epilogue level that cannot be quit. LEVEL2_NOAUTOSAVEHINT = 0x40000000, // tell the game that an autosave for this level does not need to be kept + LEVEL2_FORGETSTATE = 0x80000000, // forget this map's state in a hub }; diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 1d229267e..4614afd3d 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1264,6 +1264,8 @@ MapFlagHandlers[] = { "endofgame", MITYPE_SETFLAG2, LEVEL2_ENDGAME, 0 }, { "nostatistics", MITYPE_SETFLAG2, LEVEL2_NOSTATISTICS, 0 }, { "noautosavehint", MITYPE_SETFLAG2, LEVEL2_NOAUTOSAVEHINT, 0 }, + { "forgetstate", MITYPE_SETFLAG2, LEVEL2_FORGETSTATE, 0 }, + { "rememberstate", MITYPE_CLRFLAG2, LEVEL2_FORGETSTATE, 0 }, { "unfreezesingleplayerconversations",MITYPE_SETFLAG2, LEVEL2_CONV_SINGLE_UNFREEZE, 0 }, { "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes { "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 },