From 2b8a80c6ce03ffde0b4c828d40943703023754bb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 29 May 2021 13:19:44 +0200 Subject: [PATCH] - added the out-of-bounds vertex handler to the secondary triangulator as well. If SW does this, triangulation must not be attempted as it will inevitably fail. --- source/core/sectorgeometry.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index ba056f0ef..801c7889e 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -350,6 +350,12 @@ bool SectorGeometry::MakeVertices2(unsigned int secnum, int plane, const FVector auto wallp = &wall[sline->startpoint]; vertexes[j].p = { wallp->x * (1 / 16.), wallp->y * (1 / -16.) }; + if (fabs(vertexes[j].p.X) > 32768.f || fabs(vertexes[j].p.Y) > 32768.f) + { + // If we get here there's some fuckery going around with the coordinates. Let's better abort and wait for things to realign. + return true; + } + lines[j].backsector = nullptr; lines[j].frontsector = sectorp; lines[j].linenum = j;