From ed211ecbabab1d8451aa8b2f40610c0abe430087 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 15 Apr 2016 15:02:28 +0200 Subject: [PATCH] - fixed positioning of portal things In some situations it can happen that the sector here is not the frontsector of the anchor linedef, because some colinear node line with opposite direction causes this to be positioned on the wrong side. The only remedy here is to explicitly set the correct sector after spawning these things. --- src/p_spec.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 994f7584d9..33e09bf033 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -966,6 +966,13 @@ void P_SpawnPortal(line_t *line, int sectortag, int plane, int bytealpha, int li AStackPoint *anchor = Spawn(pos1, NO_REPLACE); AStackPoint *reference = Spawn(pos2, NO_REPLACE); + + // In some situations it can happen that the sector here is not the frontsector of the anchor linedef, + // because some colinear node line with opposite direction causes this to be positioned on the wrong side. + // Fortunately these things will never move so it should be sufficient to set the intended sector directly. + anchor->Sector = line->frontsector; + reference->Sector = lines[i].frontsector; + reference->special1 = linked ? SKYBOX_LINKEDPORTAL : SKYBOX_PORTAL; anchor->special1 = SKYBOX_ANCHOR; // store the portal displacement in the unused scaleX/Y members of the portal reference actor.