From 66d287ea81a3435d03688a42f7e758a71f3bc3f5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 8 Dec 2016 10:16:22 +0100 Subject: [PATCH] - fixed: Stepping through a ceiling portal on a two-sided line did not work. - fixed: Stepping up an actor checked against the sector's own ceiling, even if it was a crossable portal. --- src/p_map.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 16a5933d5..f889069f1 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -860,6 +860,20 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec FLineOpening open; P_LineOpening(open, tm.thing, ld, ref, &cres.Position, cres.portalflags); + if (!tm.thing->Sector->PortalBlocksMovement(sector_t::ceiling)) + { + sector_t *oppsec = cres.line->frontsector == tm.thing->Sector ? cres.line->backsector : cres.line->frontsector; + if (oppsec->PortalBlocksMovement(sector_t::ceiling)) + { + double portz = tm.thing->Sector->GetPortalPlaneZ(sector_t::ceiling); + if (tm.thing->Z() < portz && tm.thing->Z() + tm.thing->MaxStepHeight >= portz && tm.floorz < portz) + { + // Actor is stepping through a portal. + tm.portalstep = true; + return true; + } + } + } // [RH] Steep sectors count as dropoffs, if the actor touches the boundary between a steep slope and something else if (!(tm.thing->flags & MF_DROPOFF) && @@ -2130,7 +2144,7 @@ bool P_TryMove(AActor *thing, const DVector2 &pos, goto pushline; } else if (BlockingMobj->Top() - thing->Z() > thing->MaxStepHeight - || (BlockingMobj->Sector->ceilingplane.ZatPoint(pos) - (BlockingMobj->Top()) < thing->Height) + || ((BlockingMobj->Sector->ceilingplane.ZatPoint(pos) - (BlockingMobj->Top()) < thing->Height) && BlockingMobj->Sector->PortalBlocksMovement(sector_t::ceiling)) || (tm.ceilingz - (BlockingMobj->Top()) < thing->Height)) { goto pushline;