diff --git a/src/actionspecials.h b/src/actionspecials.h index 4ab222b2c..9b9c38cb9 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -42,7 +42,7 @@ DEFINE_SPECIAL(Ceiling_LowerByValue, 40, 3, 5, 5) DEFINE_SPECIAL(Ceiling_RaiseByValue, 41, 3, 4, 4) DEFINE_SPECIAL(Ceiling_CrushAndRaise, 42, 3, 4, 4) DEFINE_SPECIAL(Ceiling_LowerAndCrush, 43, 3, 4, 4) -DEFINE_SPECIAL(Ceiling_CrushStop, 44, 1, 1, 1) +DEFINE_SPECIAL(Ceiling_CrushStop, 44, 1, 2, 2) DEFINE_SPECIAL(Ceiling_CrushRaiseAndStay, 45, 3, 4, 4) DEFINE_SPECIAL(Floor_CrushStop, 46, 1, 1, 1) DEFINE_SPECIAL(Ceiling_MoveToValue, 47, 3, 5, 5) @@ -59,7 +59,7 @@ DEFINE_SPECIAL(Sector_SetPortal, 57, -1, -1, 5) DEFINE_SPECIAL(Sector_CopyScroller, 58, -1, -1, 2) DEFINE_SPECIAL(Polyobj_OR_MoveToSpot, 59, 3, 3, 3) DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3, 3) -DEFINE_SPECIAL(Plat_Stop, 61, 1, 1, 1) +DEFINE_SPECIAL(Plat_Stop, 61, 1, 2, 2) DEFINE_SPECIAL(Plat_DownWaitUpStay, 62, 3, 3, 3) DEFINE_SPECIAL(Plat_DownByValue, 63, 4, 4, 4) DEFINE_SPECIAL(Plat_UpWaitDownStay, 64, 3, 3, 3) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index ca5d8293c..5bb51129a 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -109,7 +109,6 @@ static FCompatOption Options[] = { "ignoreteleporttags", BCOMPATF_BADTELEPORTERS, SLOT_BCOMPAT }, { "rebuildnodes", BCOMPATF_REBUILDNODES, SLOT_BCOMPAT }, { "linkfrozenprops", BCOMPATF_LINKFROZENPROPS, SLOT_BCOMPAT }, - { "disablepushwindowcheck", BCOMPATF_NOWINDOWCHECK, SLOT_BCOMPAT }, { "floatbob", BCOMPATF_FLOATBOB, SLOT_BCOMPAT }, { "noslopeid", BCOMPATF_NOSLOPEID, SLOT_BCOMPAT }, @@ -149,6 +148,7 @@ static FCompatOption Options[] = { "pointonline", COMPATF2_POINTONLINE, SLOT_COMPAT2 }, { "multiexit", COMPATF2_MULTIEXIT, SLOT_COMPAT2 }, { "teleport", COMPATF2_TELEPORT, SLOT_COMPAT2 }, + { "disablepushwindowcheck", COMPATF2_PUSHWINDOW, SLOT_COMPAT2 }, { NULL, 0, 0 } }; diff --git a/src/d_main.cpp b/src/d_main.cpp index 4e360a38e..9f4568614 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -574,7 +574,7 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL) case 4: // Old ZDoom compat mode v = COMPATF_SOUNDTARGET | COMPATF_LIGHT; - w = COMPATF2_MULTIEXIT | COMPATF2_TELEPORT; + w = COMPATF2_MULTIEXIT | COMPATF2_TELEPORT | COMPATF2_PUSHWINDOW; break; case 5: // MBF compat mode @@ -631,6 +631,7 @@ CVAR (Flag, compat_soundcutoff, compatflags2, COMPATF2_SOUNDCUTOFF); CVAR (Flag, compat_pointonline, compatflags2, COMPATF2_POINTONLINE); CVAR (Flag, compat_multiexit, compatflags2, COMPATF2_MULTIEXIT); CVAR (Flag, compat_teleport, compatflags2, COMPATF2_TELEPORT); +CVAR (Flag, compat_pushwindow, compatflags2, COMPATF2_PUSHWINDOW); //========================================================================== // diff --git a/src/doomdef.h b/src/doomdef.h index a36a7a1c2..5a1d1f95f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -342,7 +342,8 @@ enum : unsigned int 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_PointOnDivlineSideCompat() COMPATF2_MULTIEXIT = 1 << 4, // Level exit can be triggered multiple times (required by Daedalus's travel tubes, thanks to a faulty script) - COMPATF2_TELEPORT = 1 << 5, // Don't let indirect teleports trigger sector actions + COMPATF2_TELEPORT = 1 << 5, // Don't let indirect teleports trigger sector actions + COMPATF2_PUSHWINDOW = 1 << 6, // Disable the window check in CheckForPushSpecial() }; // Emulate old bugs for select maps. These are not exposed by a cvar @@ -356,7 +357,6 @@ enum BCOMPATF_BADPORTALS = 1 << 4, // Restores the old unstable portal behavior BCOMPATF_REBUILDNODES = 1 << 5, // Force node rebuild BCOMPATF_LINKFROZENPROPS = 1 << 6, // Clearing PROP_TOTALLYFROZEN or PROP_FROZEN also clears the other - BCOMPATF_NOWINDOWCHECK = 1 << 7, // Disable the window check in CheckForPushSpecial() BCOMPATF_FLOATBOB = 1 << 8, // Use Hexen's original method of preventing floatbobbing items from falling down BCOMPATF_NOSLOPEID = 1 << 9, // disable line IDs on slopes. }; diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 7d3df69e0..ac1552b99 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1342,6 +1342,7 @@ MapFlagHandlers[] = { "compat_pointonline", MITYPE_COMPATFLAG, 0, COMPATF2_POINTONLINE }, { "compat_multiexit", MITYPE_COMPATFLAG, 0, COMPATF2_MULTIEXIT }, { "compat_teleport", MITYPE_COMPATFLAG, 0, COMPATF2_TELEPORT }, + { "compat_pushwindow", MITYPE_COMPATFLAG, 0, COMPATF2_PUSHWINDOW }, { "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/p_ceiling.cpp b/src/p_ceiling.cpp index c635d9743..888b67b6c 100644 --- a/src/p_ceiling.cpp +++ b/src/p_ceiling.cpp @@ -552,21 +552,31 @@ void P_ActivateInStasisCeiling (int tag) // //============================================================================ -bool EV_CeilingCrushStop (int tag) +bool EV_CeilingCrushStop (int tag, bool remove) { bool rtn = false; DCeiling *scan; TThinkerIterator iterator; - while ( (scan = iterator.Next ()) ) + scan = iterator.Next(); + while (scan != nullptr) { + DCeiling *next = iterator.Next(); if (scan->m_Tag == tag && scan->m_Direction != 0) { - SN_StopSequence (scan->m_Sector, CHAN_CEILING); - scan->m_OldDirection = scan->m_Direction; - scan->m_Direction = 0; // in-stasis; + if (!remove) + { + SN_StopSequence(scan->m_Sector, CHAN_CEILING); + scan->m_OldDirection = scan->m_Direction; + scan->m_Direction = 0; // in-stasis; + } + else + { + scan->Destroy(); + } rtn = true; } + scan = next; } return rtn; diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index f1eae4928..cf50a1dfa 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -689,9 +689,22 @@ FUNC(LS_Ceiling_LowerAndCrushDist) } FUNC(LS_Ceiling_CrushStop) -// Ceiling_CrushStop (tag) +// Ceiling_CrushStop (tag, remove) { - return EV_CeilingCrushStop (arg0); + bool remove; + switch (arg3) + { + case 1: + remove = false; + break; + case 2: + remove = true; + break; + default: + remove = gameinfo.gametype == GAME_Hexen; + break; + } + return EV_CeilingCrushStop (arg0, remove); } FUNC(LS_Ceiling_CrushRaiseAndStay) @@ -893,9 +906,22 @@ FUNC(LS_Plat_PerpetualRaiseLip) } FUNC(LS_Plat_Stop) -// Plat_Stop (tag) +// Plat_Stop (tag, remove?) { - EV_StopPlat (arg0); + bool remove; + switch (arg3) + { + case 1: + remove = false; + break; + case 2: + remove = true; + break; + default: + remove = gameinfo.gametype == GAME_Hexen; + break; + } + EV_StopPlat(arg0, remove); return true; } diff --git a/src/p_map.cpp b/src/p_map.cpp index ec9fea20a..278249a64 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1912,7 +1912,7 @@ static void CheckForPushSpecial(line_t *line, int side, AActor *mobj, DVector2 * { if (line->special && !(mobj->flags6 & MF6_NOTRIGGER)) { - if (posforwindowcheck && !(ib_compatflags & BCOMPATF_NOWINDOWCHECK) && line->backsector != NULL) + if (posforwindowcheck && !(i_compatflags2 & COMPATF2_PUSHWINDOW) && line->backsector != NULL) { // Make sure this line actually blocks us and is not a window // or similar construct we are standing inside of. DVector3 pos = mobj->PosRelative(line); diff --git a/src/p_plats.cpp b/src/p_plats.cpp index 55ba39fe5..96fec71c1 100644 --- a/src/p_plats.cpp +++ b/src/p_plats.cpp @@ -429,15 +429,21 @@ void DPlat::Stop () m_Status = in_stasis; } -void EV_StopPlat (int tag) +void EV_StopPlat (int tag, bool remove) { DPlat *scan; TThinkerIterator iterator; - while ( (scan = iterator.Next ()) ) + scan = iterator.Next(); + while (scan != nullptr) { + DPlat *next = iterator.Next(); if (scan->m_Status != DPlat::in_stasis && scan->m_Tag == tag) - scan->Stop (); + { + if (!remove) scan->Stop(); + else scan->Destroy(); + } + scan = next; } } diff --git a/src/p_spec.h b/src/p_spec.h index 125b2374e..d7abd4b42 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -212,13 +212,13 @@ private: friend bool EV_DoPlat (int tag, line_t *line, EPlatType type, double height, double speed, int delay, int lip, int change); - friend void EV_StopPlat (int tag); + friend void EV_StopPlat (int tag, bool remove); friend void P_ActivateInStasis (int tag); }; bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, double height, double speed, int delay, int lip, int change); -void EV_StopPlat (int tag); +void EV_StopPlat (int tag, bool remove); void P_ActivateInStasis (int tag); // @@ -434,14 +434,14 @@ private: DCeiling (); friend bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush); - friend bool EV_CeilingCrushStop (int tag); + friend bool EV_CeilingCrushStop (int tag, bool remove); friend void P_ActivateInStasisCeiling (int tag); }; bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush); bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line, int tag, double speed, double speed2, double height, int crush, int silent, int change, DCeiling::ECrushMode hexencrush = DCeiling::ECrushMode::crushDoom); -bool EV_CeilingCrushStop (int tag); +bool EV_CeilingCrushStop (int tag, bool remove); void P_ActivateInStasisCeiling (int tag); diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 6c4082920..d8bfefc1b 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -397,6 +397,7 @@ D62DCA9EC226DE49108D5DD9271F7631 // Cheogsh 2 map04 E89CCC7E155F1032F693359CC219BE6C // hexen.wad map30 B9DFF13207EACAC675C71D82624D0007 // XtheaterIII map01 +6941BDC2F80C0FEBE34EFA23D5FB72B7 // sonic.wad map10 { DisablePushWindowCheck } @@ -435,6 +436,17 @@ C98F79709BD7E0E4C19026AB9575EC6F // cc-cod.zip:codlev.wad map07 teleport } +8570AA0D6737C0A19DB66767764F157F // sonic.wad map04 +{ + noslopeid +} + +05AA32F1D2220A462DCDA245ED22B94B // sonic.wad map09 +{ + polyobj +} + + 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 ecfdfb1f0..05347e3e2 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2069,6 +2069,8 @@ CMPTMNU_SILENTINSTANTFLOORS = "Inst. moving floors are not silent"; CMPTMNU_SECTORSOUNDS = "Sector sounds use center as source"; CMPTMNU_SOUNDCUTOFF = "Sounds stop when actor vanishes"; CMPTMNU_SOUNDTARGET = "Use original sound target handling"; +CMPTMNU_TELEPORT = "Scripted teleports don't trigger sector actions"; +CMPTMNU_PUSHWINDOW = "Non-blocking lines can be pushed"; // Sound Options SNDMNU_TITLE = "SOUND OPTIONS"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 69313a5d7..b0c5883fa 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1333,6 +1333,8 @@ OptionMenu "CompatibilityOptions" Option "$CMPTMNU_FLOORMOVE", "compat_floormove", "YesNo" Option "$CMPTMNU_POINTONLINE", "compat_pointonline", "YesNo" Option "$CMPTMNU_MULTIEXIT", "compat_multiexit", "YesNo" + Option "$CMPTMNU_TELEPORT", "compat_teleport", "YesNo" + Option "$CMPTMNU_PUSHWINDOW", "compat_pushwindow", "YesNo" StaticText " " StaticText "$CMPTMNU_PHYSICSBEHAVIOR",1