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;