- fixed: Offsetting a vector by portals did not properly adjust the trace after crossing a portal.

This commit is contained in:
Christoph Oelckers 2016-04-16 00:17:12 +02:00
parent cd75a46917
commit eb30bf6e14

View file

@ -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;
}