From ef9f3da31de97fa8c3645f6c8465847412c2ad94 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Mar 2016 14:41:24 +0100 Subject: [PATCH] - do not use the precalculated coordinates for non-linked portals because they are not static. --- src/gl/scene/gl_portal.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/gl/scene/gl_portal.h b/src/gl/scene/gl_portal.h index 6b94e649c..89431b1c2 100644 --- a/src/gl/scene/gl_portal.h +++ b/src/gl/scene/gl_portal.h @@ -192,10 +192,23 @@ struct GLLinePortal : public GLPortal GLLinePortal(FGLLinePortal *line) { - v1 = line->v1; - v2 = line->v2; - dx = line->dx; - dy = line->dy; + if (line->reference->mType != PORTT_LINKED) + { + // For non-linked portals we must check the actual linedef. + line_t *lline = line->reference->mDestination; + v1 = lline->v1; + v2 = lline->v2; + dx = lline->dx; + dy = lline->dy; + } + else + { + // For linked portals we can check the merged span. + v1 = line->v1; + v2 = line->v2; + dx = line->dx; + dy = line->dy; + } } line_t *line()