Skip to content

Commit

Permalink
- Added the mapinfo flag ForgetState. This prevents a maps state from…
Browse files Browse the repository at this point in the history
… 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)
  • Loading branch information
Randy Heit committed Aug 23, 2012
1 parent 69fc014 commit c954fb5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/g_level.cpp
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/g_level.h
Expand Up @@ -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
};


Expand Down
2 changes: 2 additions & 0 deletions src/g_mapinfo.cpp
Expand Up @@ -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 },
Expand Down

0 comments on commit c954fb5

Please sign in to comment.