diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index a7f799c8b..ac7520170 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1683,10 +1683,18 @@ FUNC(LS_FloorAndCeiling_RaiseByValue) } FUNC(LS_FloorAndCeiling_LowerRaise) -// FloorAndCeiling_LowerRaise (tag, fspeed, cspeed) +// FloorAndCeiling_LowerRaise (tag, fspeed, cspeed, boomemu) { - return EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg2), 0, 0, 0, 0, 0, false) | - EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, 0, false); + bool res = EV_DoCeiling (DCeiling::ceilRaiseToHighest, ln, arg0, SPEED(arg2), 0, 0, 0, 0, 0, false); + // The switch based Boom equivalents of FloorandCeiling_LowerRaise do incorrect checks + // which cause the floor only to move when the ceiling fails to do so. + // To avoid problems with maps that have incorrect args this only uses a + // more or less unintuitive value for the fourth arg to trigger Boom's broken behavior + if (arg3 != 1998 || !res) // (1998 for the year in which Boom was released... :P) + { + res |= EV_DoFloor (DFloor::floorLowerToLowest, ln, arg0, SPEED(arg1), 0, 0, 0, false); + } + return res; } FUNC(LS_Elevator_MoveToFloor) diff --git a/wadsrc/static/xlat/base.txt b/wadsrc/static/xlat/base.txt index 45b23e52f..c4e0cc083 100644 --- a/wadsrc/static/xlat/base.txt +++ b/wadsrc/static/xlat/base.txt @@ -168,7 +168,7 @@ include "xlat/defines.i" 163 = USE, Plat_Stop (tag) 164 = USE, Ceiling_CrushAndRaiseA (tag, C_NORMAL, C_NORMAL, 10) 165 = USE, Ceiling_CrushAndRaiseSilentA (tag, C_SLOW, C_SLOW, 10) -166 = USE, FloorAndCeiling_LowerRaise (tag, F_SLOW, C_SLOW) +166 = USE, FloorAndCeiling_LowerRaise (tag, F_SLOW, C_SLOW, 1998) 167 = USE, Ceiling_LowerAndCrush (tag, C_SLOW, 0, 2) 168 = USE, Ceiling_CrushStop (tag) 169 = USE, Light_MaxNeighbor (tag) @@ -188,7 +188,7 @@ include "xlat/defines.i" 183 = USE|REP, Ceiling_CrushAndRaiseA (tag, C_NORMAL, C_NORMAL, 10) 184 = USE|REP, Ceiling_CrushAndRaiseA (tag, C_SLOW, C_SLOW, 10) 185 = USE|REP, Ceiling_CrushAndRaiseSilentA (tag, C_SLOW, C_SLOW, 10) -186 = USE|REP, FloorAndCeiling_LowerRaise (tag, F_SLOW, C_SLOW) +186 = USE|REP, FloorAndCeiling_LowerRaise (tag, F_SLOW, C_SLOW, 1998) 187 = USE|REP, Ceiling_LowerAndCrush (tag, C_SLOW, 0, 2) 188 = USE|REP, Ceiling_CrushStop (tag) 189 = USE, Floor_TransferTrigger (tag)