From 5df079c65355f0b82aab7e0b1c2afd378af74d4d Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Wed, 23 Jun 2021 22:21:19 +0200 Subject: [PATCH] Backwards compatibility: Add back bouncy FOF sector type, but mark it as deprecated --- extras/conf/udb/Includes/SRB222_sectors.cfg | 2 ++ src/p_spec.c | 6 +++++- src/p_user.c | 13 +++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_sectors.cfg b/extras/conf/udb/Includes/SRB222_sectors.cfg index aebc8fa29..d0b7ba082 100644 --- a/extras/conf/udb/Includes/SRB222_sectors.cfg +++ b/extras/conf/udb/Includes/SRB222_sectors.cfg @@ -15,6 +15,7 @@ sectortypes 12 = "Space Countdown"; 13 = "Ramp Sector (double step-up/down)"; 14 = "Non-Ramp Sector (no step-down)"; + 15 = "Bouncy FOF "; 16 = "Trigger Line Ex. (Pushable Objects)"; 32 = "Trigger Line Ex. (Anywhere, All Players)"; 48 = "Trigger Line Ex. (Floor Touch, All Players)"; @@ -62,6 +63,7 @@ gen_sectortypes 12 = "Space Countdown"; 13 = "Ramp Sector (double step-up/down)"; 14 = "Non-Ramp Sector (no step-down)"; + 15 = "Bouncy FOF "; } second diff --git a/src/p_spec.c b/src/p_spec.c index 95aa8f8c9..6a5bb9451 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4336,7 +4336,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers break; case 13: // Ramp Sector (Increase step-up/down) case 14: // Non-Ramp Sector (Don't step-down) - case 15: // Unused + case 15: // Bouncy FOF (deprecated) break; } @@ -6140,6 +6140,10 @@ void P_SpawnSpecials(boolean fromnetsave) //Yes, this also affects other specials on the same sector. Sorry. sector->flags |= SF_TRIGGERSPECIAL_TOUCH; break; + case 15: // Bouncy FOF + CONS_Alert(CONS_WARNING, M_GetText("Deprecated bouncy FOF sector type detected. Please use linedef type 76 instead.\n")); + CheckForBouncySector = true; + break; } // Process Section 2 diff --git a/src/p_user.c b/src/p_user.c index 7ef6a8f37..048f2f1f9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2761,6 +2761,17 @@ static void P_CheckBouncySectors(player_t *player) if (!(rover->flags & FF_EXISTS)) continue; // FOFs should not be bouncy if they don't even "exist" + // Handle deprecated bouncy FOF sector type + if (GETSECSPECIAL(rover->master->frontsector->special, 1) == 15) + { + rover->flags |= FF_BOUNCY; + rover->bouncestrength = P_AproxDistance(rover->master->dx, rover->master->dy)/100; + if (rover->master->flags & ML_BOUNCY) + rover->specialflags |= FS_DAMPEN; + else + rover->specialflags &= ~FS_DAMPEN; + } + if (!(rover->flags & FF_BOUNCY)) continue; @@ -2773,8 +2784,6 @@ static void P_CheckBouncySectors(player_t *player) if (player->mo->z + player->mo->height < bottomheight) continue; - //bouncestrength = P_AproxDistance(rover->master->dx, rover->master->dy)/100; - if (oldz < P_GetFOFTopZ(player->mo, node->m_sector, rover, oldx, oldy, NULL) && oldz + player->mo->height > P_GetFOFBottomZ(player->mo, node->m_sector, rover, oldx, oldy, NULL)) {