From 027a99d7728615d7199299fe48b5f8725b5fa8f7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Feb 2013 08:53:03 +0000 Subject: [PATCH] - fixed: Hexen's Floor_RaiseAndCrush is not the same action as the one used by Doom and which was used by ZDoom before r4053. Restored the old code and gave it a new special 99:Floor_RaiseAndCrushDoom. SVN r4125 (trunk) --- src/actionspecials.h | 2 +- src/p_floor.cpp | 7 ++++++- src/p_lnspec.cpp | 8 +++++++- src/p_spec.h | 1 + wadsrc/static/xlat/base.txt | 8 ++++---- wadsrc/static/xlat/strife.txt | 8 ++++---- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/actionspecials.h b/src/actionspecials.h index b894a453a6..1377def82a 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -97,7 +97,7 @@ DEFINE_SPECIAL(FloorAndCeiling_LowerByValue, 95, 3, 3, 3) DEFINE_SPECIAL(FloorAndCeiling_RaiseByValue, 96, 3, 3, 3) DEFINE_SPECIAL(Ceiling_LowerAndCrushDist, 97, 3, 5, 5) DEFINE_SPECIAL(Sector_SetTranslucent, 98, 3, 4, 4) - +DEFINE_SPECIAL(Floor_RaiseAndCrushDoom, 99, 3, 4, 4) DEFINE_SPECIAL(Scroll_Texture_Left, 100, -1, -1, 2) DEFINE_SPECIAL(Scroll_Texture_Right, 101, -1, -1, 2) DEFINE_SPECIAL(Scroll_Texture_Up, 102, -1, -1, 2) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index ea2551dfd8..3e2de1679b 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -375,13 +375,18 @@ manual_floor: floor->m_Direction = (floor->m_FloorDestDist > sec->floorplane.d) ? -1 : 1; break; + case DFloor::floorRaiseAndCrushDoom: + floor->m_Crush = crush; case DFloor::floorRaiseToLowestCeiling: floor->m_Direction = 1; newheight = sec->FindLowestCeilingSurrounding (&spot); + if (floortype == DFloor::floorRaiseAndCrush) + newheight -= 8 * FRACUNIT; ceilingheight = sec->FindLowestCeilingPoint (&spot2); floor->m_FloorDestDist = sec->floorplane.PointToDist (spot, newheight); if (sec->floorplane.ZatPointDist (spot2, floor->m_FloorDestDist) > ceilingheight) - floor->m_FloorDestDist = sec->floorplane.PointToDist (spot2, ceilingheight); + floor->m_FloorDestDist = sec->floorplane.PointToDist (spot2, + floortype == DFloor::floorRaiseAndCrush ? ceilingheight - 8*FRACUNIT : ceilingheight); break; case DFloor::floorRaiseToHighest: diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 0c84ca4eed..8b461f9cb3 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -326,6 +326,12 @@ FUNC(LS_Floor_RaiseAndCrush) return EV_DoFloor (DFloor::floorRaiseAndCrush, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3)); } +FUNC(LS_Floor_RaiseAndCrushDoom) +// Floor_RaiseAndCrushDoom (tag, speed, crush, crushmode) +{ + return EV_DoFloor (DFloor::floorRaiseAndCrushDoom, ln, arg0, SPEED(arg1), 0, arg2, 0, CRUSHTYPE(arg3)); +} + FUNC(LS_Floor_RaiseByValueTimes8) // FLoor_RaiseByValueTimes8 (tag, speed, height) { @@ -3232,7 +3238,7 @@ lnSpecFunc LineSpecials[256] = /* 96 */ LS_FloorAndCeiling_RaiseByValue, /* 97 */ LS_Ceiling_LowerAndCrushDist, /* 98 */ LS_Sector_SetTranslucent, - /* 99 */ LS_NOP, + /* 99 */ LS_Floor_RaiseAndCrushDoom, /* 100 */ LS_NOP, // Scroll_Texture_Left /* 101 */ LS_NOP, // Scroll_Texture_Right /* 102 */ LS_NOP, // Scroll_Texture_Up diff --git a/src/p_spec.h b/src/p_spec.h index 81051eb8e7..4f67f87ffb 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -697,6 +697,7 @@ public: floorRaiseToHighest, floorRaiseToNearest, floorRaiseAndCrush, + floorRaiseAndCrushDoom, floorCrushStop, floorLowerInstant, floorRaiseInstant, diff --git a/wadsrc/static/xlat/base.txt b/wadsrc/static/xlat/base.txt index 44d5457b2e..11b9fd315d 100644 --- a/wadsrc/static/xlat/base.txt +++ b/wadsrc/static/xlat/base.txt @@ -54,8 +54,8 @@ include "xlat/defines.i" 52 = WALK, Exit_Normal (0) 53 = WALK, Plat_PerpetualRaiseLip (tag, P_SLOW, PLATWAIT, 0) 54 = WALK, Plat_Stop (tag) - 55 = USE, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) - 56 = WALK, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 55 = USE, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) + 56 = WALK, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 57 = WALK, Ceiling_CrushStop (tag) 58 = WALK, Floor_RaiseByValue (tag, F_SLOW, 24) 59 = WALK, Floor_RaiseByValueTxTy (tag, F_SLOW, 24) @@ -64,7 +64,7 @@ include "xlat/defines.i" 62 = USE|REP, Plat_DownWaitUpStayLip (tag, P_FAST, PLATWAIT, 0) 63 = USE|REP, Door_Raise (tag, D_SLOW, VDOORWAIT) 64 = USE|REP, Floor_RaiseToLowestCeiling (tag, F_SLOW) - 65 = USE|REP, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 65 = USE|REP, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 66 = USE|REP, Plat_UpByValueStayTx (tag, P_SLOW/2, 3) 67 = USE|REP, Plat_UpByValueStayTx (tag, P_SLOW/2, 4) 68 = USE|REP, Plat_RaiseAndStayTx0 (tag, P_SLOW/2) @@ -93,7 +93,7 @@ include "xlat/defines.i" 91 = WALK|REP, Floor_RaiseToLowestCeiling (tag, F_SLOW) 92 = WALK|REP, Floor_RaiseByValue (tag, F_SLOW, 24) 93 = WALK|REP, Floor_RaiseByValueTxTy (tag, F_SLOW, 24) - 94 = WALK|REP, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 94 = WALK|REP, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 95 = WALK|REP, Plat_RaiseAndStayTx0 (tag, P_SLOW/2) 96 = WALK|REP, Floor_RaiseByTexture (tag, F_SLOW) 97 = WALK|REP|MONST, Teleport (0, tag) diff --git a/wadsrc/static/xlat/strife.txt b/wadsrc/static/xlat/strife.txt index a5aada362b..5666fbeb65 100644 --- a/wadsrc/static/xlat/strife.txt +++ b/wadsrc/static/xlat/strife.txt @@ -113,7 +113,7 @@ RetailOnly = 121 52 = WALK|REP, ACS_ExecuteAlways (0, 0, 52, tag) 53 = WALK, Plat_PerpetualRaiseLip (tag, P_SLOW, PLATWAIT, 0) 54 = WALK, Plat_Stop (tag) - 56 = WALK, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 56 = WALK, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 57 = WALK, Ceiling_CrushStop (tag) 58 = WALK, Floor_RaiseByValue (tag, F_SLOW, 64) 59 = WALK, Floor_RaiseByValueTxTy (tag, F_SLOW, 24) @@ -164,7 +164,7 @@ RetailOnly = 121 91 = WALK|REP, Floor_RaiseToLowestCeiling (tag, F_SLOW) 92 = WALK|REP, Floor_RaiseByValue (tag, F_SLOW, 64) 93 = WALK|REP, Floor_RaiseByValueTxTy (tag, F_SLOW, 24) - 94 = WALK|REP, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 94 = WALK|REP, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 95 = WALK|REP, Plat_RaiseAndStayTx0 (tag, P_SLOW/2) 96 = WALK|REP, Floor_RaiseByTexture (tag, F_SLOW) 97 = WALK|REP|MONST, Teleport (0, tag) @@ -247,7 +247,7 @@ RetailOnly = 121 49 = USE, Ceiling_CrushAndRaiseDist (tag, 8, C_SLOW, 0, 2) 50 = USE, Door_Close (tag, D_SLOW) 51 = USE, Teleport_EndGame (0) - 55 = USE, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 55 = USE, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 101 = USE, Floor_RaiseToLowestCeiling (tag, F_SLOW) 102 = USE, Floor_LowerToHighest (tag, F_SLOW, 128) 103 = USE, Door_Open (tag, D_SLOW) @@ -289,7 +289,7 @@ RetailOnly = 121 64 = USE|REP, Floor_RaiseToLowestCeiling (tag, F_SLOW) 66 = USE|REP, Plat_UpByValueStayTx (tag, P_SLOW/2, 3) 67 = USE|REP, Plat_UpByValueStayTx (tag, P_SLOW/2, 4) - 65 = USE|REP, Floor_RaiseAndCrush (tag, F_SLOW, 10, 2) + 65 = USE|REP, Floor_RaiseAndCrushDoom (tag, F_SLOW, 10, 2) 68 = USE|REP, Plat_RaiseAndStayTx0 (tag, P_SLOW/2) 69 = USE|REP, Floor_RaiseToNearest (tag, F_SLOW) 70 = USE|REP, Floor_LowerToHighest (tag, F_FAST, 128)