From 6dfb4bdd4104d64aa8e5667df9951b7adeebbc02 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 15 Apr 2016 20:42:40 +0200 Subject: [PATCH] - changed floor and ceiling movers so that portal planes do not block movement of the opposite plane, even if they are on the wrong side of it. This fixes the cross-portal lift to the blue key in Vaporware. --- src/dsectoreffect.cpp | 2 ++ src/p_linkedsectors.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dsectoreffect.cpp b/src/dsectoreffect.cpp index 499eb96c8d..180aa9e817 100644 --- a/src/dsectoreffect.cpp +++ b/src/dsectoreffect.cpp @@ -218,6 +218,7 @@ EMoveResult sector_t::MoveFloor(double speed, double dest, int crush, int direct // [RH] not so easy with arbitrary planes //destheight = (dest < ceilingheight) ? dest : ceilingheight; if (!ceilingplane.isSlope() && !floorplane.isSlope() && + !PortalIsLinked(sector_t::ceiling) && (!(i_compatflags2 & COMPATF2_FLOORMOVE) && -dest > ceilingplane.fD())) { dest = -ceilingplane.fD(); @@ -294,6 +295,7 @@ EMoveResult sector_t::MoveCeiling(double speed, double dest, int crush, int dire // [RH] not so easy with arbitrary planes //destheight = (dest > floorheight) ? dest : floorheight; if (!ceilingplane.isSlope() && !floorplane.isSlope() && + !PortalIsLinked(sector_t::floor) && (!(i_compatflags2 & COMPATF2_FLOORMOVE) && dest < -floorplane.fD())) { dest = -floorplane.fD(); diff --git a/src/p_linkedsectors.cpp b/src/p_linkedsectors.cpp index 9a451460cd..583175deff 100644 --- a/src/p_linkedsectors.cpp +++ b/src/p_linkedsectors.cpp @@ -102,7 +102,8 @@ static bool MoveCeiling(sector_t *sector, int crush, double move) // Don't let the ceiling go below the floor if (!sector->ceilingplane.isSlope() && !sector->floorplane.isSlope() && - sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false; + !sector->PortalIsLinked(sector_t::floor) && + sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false; return true; } @@ -116,6 +117,7 @@ static bool MoveFloor(sector_t *sector, int crush, double move) // Don't let the floor go above the ceiling if (!sector->ceilingplane.isSlope() && !sector->floorplane.isSlope() && + !sector->PortalIsLinked(sector_t::ceiling) && sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false; return true;