From f212421547cb5b919fa47786b1050c40d14a7ae9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 May 2021 17:19:01 +0200 Subject: [PATCH] - don't let the triangulator choke on empty sectors. --- source/core/nodebuilder/nodebuild_utility.cpp | 5 ----- source/core/sectorgeometry.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/core/nodebuilder/nodebuild_utility.cpp b/source/core/nodebuilder/nodebuild_utility.cpp index afc321668..9f6f7e674 100644 --- a/source/core/nodebuilder/nodebuild_utility.cpp +++ b/source/core/nodebuilder/nodebuild_utility.cpp @@ -115,11 +115,6 @@ void FNodeBuilder::MakeSegsFromSides () { int i, j; - if (Level.NumLines == 0) - { - I_Error ("Map is empty.\n"); - } - for (i = 0; i < Level.NumLines; ++i) { if (Level.Lines[i].sidedef[0] != NULL) diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 29d27991a..62af2902a 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -456,6 +456,14 @@ bool SectorGeometry::MakeVertices2(unsigned int secnum, int plane, const FVector nexti:; } + if (lines.Size() == 0) + { + // nothing to generate. + auto& entry = data[secnum].planes[plane]; + entry.vertices.Clear(); + entry.texcoords.Clear(); + return true; + } FNodeBuilder::FLevel leveldata =