From 572f45ca5359331f11519b55b9de1dd88ee42c89 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 May 2021 16:36:06 +0200 Subject: [PATCH] - delete lines in proper order when eliminating a pair. Deleting the lower one first will delete the wrong second one. --- source/core/sectorgeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index c7f3c9f25..29d27991a 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -385,8 +385,8 @@ bool SectorGeometry::MakeVertices2(unsigned int secnum, int plane, const FVector { // handle the simple case first, i.e. line j is the inverse of line i. // in this case both lines need to be deleted. - lines.Delete(i); lines.Delete(j); + lines.Delete(i); i--; goto nexti; } @@ -433,7 +433,7 @@ bool SectorGeometry::MakeVertices2(unsigned int secnum, int plane, const FVector double pp1x = vert ? pp1.X : pp1.Y; double pp2x = vert ? pp2.X : pp2.Y; - if (pp1x > min(p1x, p2x) && pp2x < max(p1x, p2x)) + if (pp1x > min(p1x, p2x) && pp1x < max(p1x, p2x)) { // pp1 is on line i. lines[i].v1 = lines[j].v1;