From c954fb54773035c984730ce24aec78e21b63bebf Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 23 Aug 2012 00:31:29 +0000 Subject: [PATCH] - Added the mapinfo flag ForgetState. This prevents a maps state from being remembered in a hub, so when you return to it without leaving the hub, it will be as if you had never set foot in it. RememberState is provided to turn this flag off. SVN r3846 (trunk) --- src/g_level.cpp | 9 ++++++++- src/g_level.h | 1 + src/g_mapinfo.cpp | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index e6b8bad917..32acf14cba 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 c246e5b7e6..488cb3eaf2 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 1d229267ef..4614afd3d8 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 },