diff --git a/src/p_checkposition.h b/src/p_checkposition.h index 98891b87c4..c475e282d5 100644 --- a/src/p_checkposition.h +++ b/src/p_checkposition.h @@ -36,6 +36,7 @@ struct FCheckPosition TMap LastRipped; bool DoRipping; bool portalstep; + int portalgroup; int PushTime; diff --git a/src/p_map.cpp b/src/p_map.cpp index 0aa3b58ad2..86444a8f88 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -161,6 +161,7 @@ DEFINE_FIELD_X(FCheckPosition, FCheckPosition, ceilingline); DEFINE_FIELD_X(FCheckPosition, FCheckPosition, stepthing); DEFINE_FIELD_X(FCheckPosition, FCheckPosition, DoRipping); DEFINE_FIELD_X(FCheckPosition, FCheckPosition, portalstep); +DEFINE_FIELD_X(FCheckPosition, FCheckPosition, portalgroup); DEFINE_FIELD_X(FCheckPosition, FCheckPosition, PushTime); //========================================================================== @@ -288,6 +289,7 @@ static bool PIT_FindFloorCeiling(FMultiBlockLinesIterator &mit, FMultiBlockLines } } + // If we are stepping through a portal the line's opening must be checked, regardless of the NOFLOOR flag if (!(flags & FFCF_NOFLOOR)) { if (open.bottom > tmf.floorz) @@ -905,6 +907,7 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec tm.floorpic = cres.line->sidedef[0]->GetTexture(side_t::mid); tm.floorterrain = 0; tm.portalstep = true; + tm.portalgroup = cres.line->frontsector->GetOppositePortalGroup(sector_t::ceiling); return true; } } @@ -999,6 +1002,7 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec { // Actor is stepping through a portal. tm.portalstep = true; + tm.portalgroup = tm.thing->Sector->GetOppositePortalGroup(sector_t::ceiling); return true; } } @@ -1051,7 +1055,8 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec } } - if (!(cres.portalflags & FFCF_NOFLOOR)) + // If we are stepping through a portal the line's opening must be checked, regardless of the NOFLOOR flag + if (!(cres.portalflags & FFCF_NOFLOOR) || (tm.portalstep && open.bottomsec->PortalGroup == tm.portalgroup)) { if (open.bottom > tm.floorz) { diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 27ce423a81..9dce485db1 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -22,6 +22,7 @@ struct FCheckPosition native Actor stepthing; native bool DoRipping; native bool portalstep; + native int portalgroup; native int PushTime;