diff --git a/src/p_map.cpp b/src/p_map.cpp index ef5264f69..1a4a18d74 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4755,16 +4755,9 @@ bool P_UseTraverse(AActor *usething, fixed_t startx, fixed_t starty, fixed_t end } continue; } - if (in->d.line->isLinePortal()) + if (it.PortalRelocate(in, PT_ADDLINES | PT_ADDTHINGS, &xpos)) { - if (P_PointOnLineSide(xpos.x, xpos.y, in->d.line) == 0) - { - FLinePortal *port = in->d.line->getPortal(); - // Also translate the player origin, so that we can use that for checks further below and in P_CheckSwitchRange - it.PortalRelocate(in, PT_ADDLINES | PT_ADDTHINGS, &xpos); - } continue; - } FLineOpening open; diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 75c4e8830..c84d6d5e2 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -1618,6 +1618,8 @@ void FPathTraverse::init (fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, int fl bool FPathTraverse::PortalRelocate(intercept_t *in, int flags, fixedvec3 *optpos) { if (!in->isaline || !in->d.line->isLinePortal()) return false; + if (P_PointOnLineSidePrecise(trace.x, trace.y, in->d.line) == 1) return false; + fixed_t hitx = trace.x; fixed_t hity = trace.y; fixed_t endx = trace.x + trace.dx;