From 0341a3d75ba05e0711ff9de20fc51ec12d0f6e74 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 26 Mar 2019 00:38:54 +0100 Subject: [PATCH] - made the gross railing hack for Strife a compatibility option and restricted it to MAP04 The side effects here broke other maps and this is really too glitchy to be turned on unless really necesasary. --- src/doomdef.h | 3 ++- src/gamedata/g_mapinfo.cpp | 1 + src/gamedata/g_mapinfo.h | 2 +- src/gamedata/stringtable.cpp | 2 +- src/maploader/compatibility.cpp | 1 + src/maploader/maploader.cpp | 5 ----- src/maploader/udmf.cpp | 2 +- src/p_map.cpp | 2 +- wadsrc/static/mapinfo/strife.txt | 1 + wadsrc/static/menudef.txt | 1 + wadsrc/static/zscript/constants.zs | 3 ++- 11 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 42b5168500..1e0abadafa 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -330,7 +330,8 @@ enum : unsigned int COMPATF2_PUSHWINDOW = 1 << 6, // Disable the window check in CheckForPushSpecial() COMPATF2_CHECKSWITCHRANGE = 1 << 7, // Enable buggy CheckSwitchRange behavior COMPATF2_EXPLODE1 = 1 << 8, // No vertical explosion thrust - COMPATF2_EXPLODE2 = 1 << 9 // Use original explosion code throughout. + COMPATF2_EXPLODE2 = 1 << 9, // Use original explosion code throughout. + COMPATF2_RAILING = 1 << 10, // Bugged Strife railings. }; // Emulate old bugs for select maps. These are not exposed by a cvar diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 969affe212..6f7d88694c 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1644,6 +1644,7 @@ MapFlagHandlers[] = { "compat_checkswitchrange", MITYPE_COMPATFLAG, 0, COMPATF2_CHECKSWITCHRANGE }, { "compat_explode1", MITYPE_COMPATFLAG, 0, COMPATF2_EXPLODE1 }, { "compat_explode2", MITYPE_COMPATFLAG, 0, COMPATF2_EXPLODE2 }, + { "compat_railing", MITYPE_COMPATFLAG, 0, COMPATF2_RAILING }, { "cd_start_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end1_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end2_track", MITYPE_EATNEXT, 0, 0 }, diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index f9cd2f6f4a..f4c74de085 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -225,7 +225,7 @@ enum ELevelFlags : unsigned int LEVEL2_FORCETEAMPLAYOFF = 0x00080000, LEVEL2_CONV_SINGLE_UNFREEZE = 0x00100000, - LEVEL2_RAILINGHACK = 0x00200000, // but UDMF requires them to be separate to have more control + // = 0x00200000, // unused, was LEVEL2_RAILINGHACK LEVEL2_DUMMYSWITCHES = 0x00400000, LEVEL2_HEXENHACK = 0x00800000, // Level was defined in a Hexen style MAPINFO diff --git a/src/gamedata/stringtable.cpp b/src/gamedata/stringtable.cpp index a710ac000c..3505470c26 100644 --- a/src/gamedata/stringtable.cpp +++ b/src/gamedata/stringtable.cpp @@ -97,7 +97,7 @@ TArray> FStringTable::parseCSV(const TArray &buffer) while (vend > vcopy && myisspace((unsigned char)vend[-1])) *--vend = 0; // skip over trailing whitespace */ - for (int i = 0; i < bufLength; ++i) + for (size_t i = 0; i < bufLength; ++i) { if (buffer[i] == '"') { diff --git a/src/maploader/compatibility.cpp b/src/maploader/compatibility.cpp index 11283dbe12..63586a1a71 100644 --- a/src/maploader/compatibility.cpp +++ b/src/maploader/compatibility.cpp @@ -167,6 +167,7 @@ static FCompatOption Options[] = { "checkswitchrange", COMPATF2_CHECKSWITCHRANGE, SLOT_COMPAT2 }, { "explode1", COMPATF2_EXPLODE1, SLOT_COMPAT2 }, { "explode2", COMPATF2_EXPLODE2, SLOT_COMPAT2 }, + { "railing", COMPATF2_RAILING, SLOT_COMPAT2 }, { NULL, 0, 0 } }; diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index 81da37591a..fb5866d79c 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3004,11 +3004,6 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position) if (!map->HasBehavior && !map->isText) { - // set compatibility flags - if (gameinfo.gametype == GAME_Strife) - { - Level->flags2 |= LEVEL2_RAILINGHACK; - } Level->flags2 |= LEVEL2_DUMMYSWITCHES; } diff --git a/src/maploader/udmf.cpp b/src/maploader/udmf.cpp index b8eac3744a..a1caea6598 100644 --- a/src/maploader/udmf.cpp +++ b/src/maploader/udmf.cpp @@ -2161,7 +2161,7 @@ public: case NAME_Strife: namespace_bits = St; Level->Translator = P_LoadTranslator("xlat/strife_base.txt"); - Level->flags2 |= LEVEL2_DUMMYSWITCHES|LEVEL2_RAILINGHACK; + Level->flags2 |= LEVEL2_DUMMYSWITCHES; floordrop = true; break; default: diff --git a/src/p_map.cpp b/src/p_map.cpp index 00183fd10b..6f7165b4c5 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -976,7 +976,7 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec // better than Strife's handling of rails, which lets you jump into rails // from either side. How long until somebody reports this as a bug and I'm // forced to say, "It's not a bug. It's a feature?" Ugh. - (!(tm.thing->Level->flags2 & LEVEL2_RAILINGHACK) || + (!(tm.thing->Level->i_compatflags2 & COMPATF2_RAILING) || open.bottom == tm.thing->Sector->floorplane.ZatPoint(ref))) { open.bottom += 32; diff --git a/wadsrc/static/mapinfo/strife.txt b/wadsrc/static/mapinfo/strife.txt index b4649c2626..d38f742e67 100644 --- a/wadsrc/static/mapinfo/strife.txt +++ b/wadsrc/static/mapinfo/strife.txt @@ -627,6 +627,7 @@ map MAP04 LOOKUP "TXT_STRIFE_MAP04" sky1 = "SKYMNT02" music = "D_FAST" cluster = 1 + compat_railing } map MAP05 LOOKUP "TXT_STRIFE_MAP05" diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 12f7685ace..dc7ae08342 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1661,6 +1661,7 @@ OptionMenu "CompatPhysicsMenu" protected Option "$CMPTMNU_MISSILECLIP", "compat_MISSILECLIP", "YesNo" Option "$CMPTMNU_EXPLODE1", "compat_explode1", "YesNo" Option "$CMPTMNU_EXPLODE2", "compat_explode2", "YesNo" + Option "$CMPTMNU_RAILINGHACK", "compat_railing", "YesNo" Class "CompatibilityMenu" } diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 4fdc29fdac..ad3065fe42 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -1341,5 +1341,6 @@ enum ECompatFlags COMPATF2_PUSHWINDOW = 1 << 6, // Disable the window check in CheckForPushSpecial() COMPATF2_CHECKSWITCHRANGE = 1 << 7, // Enable buggy CheckSwitchRange behavior COMPATF2_EXPLODE1 = 1 << 8, // No vertical explosion thrust - COMPATF2_EXPLODE2 = 1 << 9 // Use original explosion code throughout. + COMPATF2_EXPLODE2 = 1 << 9, // Use original explosion code throughout. + COMPATF2_RAILING = 1 << 10, // Bugged Strife railings. };