From e5a4ed55f3d436ef60504b43f6b86aead28e0767 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Sat, 15 Jul 2023 20:25:20 +0800 Subject: [PATCH] - Serialize Level.nousersave and Level.noautomap properly - Also allow them to be settable directly in a map's MAPINFO block (NoUserSave and NoAutoMap respectively) # Conflicts: # src/p_saveg.cpp --- src/g_level.cpp | 2 ++ src/gamedata/g_mapinfo.cpp | 1 + src/p_saveg.cpp | 1 + src/scripting/vmthunks.cpp | 1 + wadsrc/static/zscript/constants.zs | 3 +++ wadsrc/static/zscript/doombase.zs | 1 + 6 files changed, 9 insertions(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index 474f85a38d..4232424471 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1801,6 +1801,7 @@ void FLevelLocals::Init() flags = 0; flags2 = 0; flags3 = 0; + flags9 = 0; ImpactDecalCount = 0; frozenstate = 0; @@ -1849,6 +1850,7 @@ void FLevelLocals::Init() flags |= info->flags; flags2 |= info->flags2; flags3 |= info->flags3; + flags9 |= info->flags9; levelnum = info->levelnum; Music = info->Music; musicorder = info->musicorder; diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 5406166d8f..b48a583a2c 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -250,6 +250,7 @@ void level_info_t::Reset() else flags2 = LEVEL2_LAXMONSTERACTIVATION; flags3 = 0; + flags9 = 0; Music = ""; LevelName = ""; AuthorName = ""; diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index ad729b0184..a5ec9ac8f5 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -970,6 +970,7 @@ void FLevelLocals::Serialize(FSerializer &arc, bool hubload) arc("flags", flags) ("flags2", flags2) ("flags3", flags3) + ("flags9", flags9) ("fadeto", fadeto) ("found_secrets", found_secrets) ("found_items", found_items) diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 44bbf27b4f..b089354058 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -2763,6 +2763,7 @@ DEFINE_FIELD_X(LevelInfo, level_info_t, sucktime) DEFINE_FIELD_X(LevelInfo, level_info_t, flags) DEFINE_FIELD_X(LevelInfo, level_info_t, flags2) DEFINE_FIELD_X(LevelInfo, level_info_t, flags3) +DEFINE_FIELD_X(LevelInfo, level_info_t, flags9) DEFINE_FIELD_X(LevelInfo, level_info_t, Music) DEFINE_FIELD_X(LevelInfo, level_info_t, LevelName) DEFINE_FIELD_X(LevelInfo, level_info_t, AuthorName) diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 4488b223f5..8d67d47f2d 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -1386,6 +1386,9 @@ enum ELevelFlags LEVEL3_AVOIDMELEE = 0x00020000, // global flag needed for proper MBF support. LEVEL3_NOJUMPDOWN = 0x00040000, // only for MBF21. Inverse of MBF's dog_jumping flag. LEVEL3_LIGHTCREATED = 0x00080000, // a light had been created in the last frame + + LEVEL9_NOUSERSAVE = 0x00000001, + LEVEL9_NOAUTOMAP = 0x00000002, }; // [RH] Compatibility flags. diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 4f224931fa..4e34ecfa90 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -337,6 +337,7 @@ struct LevelInfo native native readonly int flags; native readonly int flags2; native readonly int flags3; + native readonly int flags9; native readonly String Music; native readonly String LevelName; native readonly String AuthorName;