From eb30bf6e141c6814db2a0eb159f973a759bcf614 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 16 Apr 2016 00:17:12 +0200 Subject: [PATCH] - fixed: Offsetting a vector by portals did not properly adjust the trace after crossing a portal. --- src/portal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/portal.cpp b/src/portal.cpp index f0c5b8962..3ce45c636 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -661,10 +661,10 @@ DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy) if (blockx < 0 || blocky < 0 || blockx >= bmapwidth || blocky >= bmapheight || !PortalBlockmap(blockx, blocky).neighborContainsLines) return dest; } - FLinePortalTraverse it; bool repeat; do { + FLinePortalTraverse it; it.init(actx, acty, dx, dy, PT_ADDLINES|PT_DELTA); intercept_t *in; @@ -696,6 +696,8 @@ DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy) // update the fields, end this trace and restart from the new position dx = dest.X - hit.X; dy = dest.Y - hit.Y; + actx = hit.X; + acty = hit.Y; repeat = true; }