From 51da78ba29f693260acaee459d51224569b0ca6a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 24 Feb 2016 10:35:29 +0100 Subject: [PATCH] - added a compatibility option to allow multiple exits to be triggered. This is required by Daedalus's travel tubes which contain a faulty script with some leftover debug code. --- src/compatibility.cpp | 1 + src/d_main.cpp | 4 +++- src/doomdef.h | 1 + src/g_level.cpp | 2 +- src/g_mapinfo.cpp | 1 + wadsrc/static/compatibility.txt | 5 +++++ wadsrc/static/language.enu | 1 + wadsrc/static/menudef.txt | 1 + 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 498fefb2a5..c7df15027d 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -146,6 +146,7 @@ static FCompatOption Options[] = { "floormove", COMPATF2_FLOORMOVE, SLOT_COMPAT2 }, { "soundcutoff", COMPATF2_SOUNDCUTOFF, SLOT_COMPAT2 }, { "pointonline", COMPATF2_POINTONLINE, SLOT_COMPAT2 }, + { "multiexit", COMPATF2_MULTIEXIT, SLOT_COMPAT2 }, { NULL, 0, 0 } }; diff --git a/src/d_main.cpp b/src/d_main.cpp index d2120f88e1..bf451e4086 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -572,7 +572,8 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL) break; case 4: // Old ZDoom compat mode - v = COMPATF_SOUNDTARGET|COMPATF_LIGHT; + v = COMPATF_SOUNDTARGET | COMPATF_LIGHT; + w = COMPATF2_MULTIEXIT; break; case 5: // MBF compat mode @@ -627,6 +628,7 @@ CVAR (Flag, compat_badangles, compatflags2, COMPATF2_BADANGLES); CVAR (Flag, compat_floormove, compatflags2, COMPATF2_FLOORMOVE); CVAR (Flag, compat_soundcutoff, compatflags2, COMPATF2_SOUNDCUTOFF); CVAR (Flag, compat_pointonline, compatflags2, COMPATF2_POINTONLINE); +CVAR (Flag, compat_multiexit, compatflags2, COMPATF2_MULTIEXIT); //========================================================================== // diff --git a/src/doomdef.h b/src/doomdef.h index 802591386c..3b066f8d8b 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -341,6 +341,7 @@ enum COMPATF2_FLOORMOVE = 1 << 1, // Use the same floor motion behavior as Doom. COMPATF2_SOUNDCUTOFF = 1 << 2, // Cut off sounds when an actor vanishes instead of making it owner-less COMPATF2_POINTONLINE = 1 << 3, // Use original but buggy P_PointOnLineSide() and P_PointOnDivlineSide() + COMPATF2_MULTIEXIT = 1 << 4, // Level exit can be triggered multiple times (required by Daedalus's travel tubes, thanks to a faulty script) }; // Emulate old bugs for select maps. These are not exposed by a cvar diff --git a/src/g_level.cpp b/src/g_level.cpp index 5f305e5df1..cfdfef9f5c 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -535,7 +535,7 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill Printf (TEXTCOLOR_RED "Unloading scripts cannot exit the level again.\n"); return; } - if (gameaction == ga_completed) // do not exit multiple times. + if (gameaction == ga_completed && !(i_compatflags2 & COMPATF2_MULTIEXIT)) // do not exit multiple times. { return; } diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 1b1023fcd2..b78dccf0db 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1328,6 +1328,7 @@ MapFlagHandlers[] = { "compat_floormove", MITYPE_COMPATFLAG, 0, COMPATF2_FLOORMOVE }, { "compat_soundcutoff", MITYPE_COMPATFLAG, 0, COMPATF2_SOUNDCUTOFF }, { "compat_pointonline", MITYPE_COMPATFLAG, 0, COMPATF2_POINTONLINE }, + { "compat_multiexit", MITYPE_COMPATFLAG, 0, COMPATF2_MULTIEXIT }, { "cd_start_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end1_track", MITYPE_EATNEXT, 0, 0 }, { "cd_end2_track", MITYPE_EATNEXT, 0, 0 }, diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 0bd924622f..0e25effb85 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -411,6 +411,11 @@ D0139194F7817BF06F3988DFC47DB38D // Whispers of Satan map29 nopassover } +5397C3B7D9B33AAF526D15A81A762828 // daedalus.wad Travel tubes (they are all identical) +{ + multiexit +} + D7F6E9F08C39A17026349A04F8C0B0BE // Return to Hadron, e1m9 19D03FFC875589E21EDBB7AB74EF4AEF // Return to Hadron, e1m9, 2016.01.03 update { diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 1fbf83b087..12ac43fa9f 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2035,6 +2035,7 @@ CMPTMNU_SHORTTEX = "Find shortest textures like Doom"; CMPTMNU_STAIRS = "Use buggier stair building"; CMPTMNU_FLOORMOVE = "Use Doom's floor motion behavior"; CMPTMNU_POINTONLINE = "Use Doom's point-on-line algorithm"; +CMPTMNU_MULTIEXIT = "Level exit can be triggered more than once." CMPTMNU_PHYSICSBEHAVIOR = "Physics Behavior"; CMPTMNU_NOPASSOVER = "Actors are infinitely tall"; CMPTMNU_BOOMSCROLL = "Boom scrollers are additive"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index ab32efa65e..40b24f6e52 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1304,6 +1304,7 @@ OptionMenu "CompatibilityOptions" Option "$CMPTMNU_STAIRS", "compat_stairs", "YesNo" Option "$CMPTMNU_FLOORMOVE", "compat_floormove", "YesNo" Option "$CMPTMNU_POINTONLINE", "compat_pointonline", "YesNo" + Option "$CMPTMNU_MULTIEXIT", "compat_multiexit", "YesNo" StaticText " " StaticText "$CMPTMNU_PHYSICSBEHAVIOR",1