From 05e144a5caa69b0a74a01952a0dceed4c3fcd708 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 14 Feb 2017 20:18:31 -0700 Subject: [PATCH] light: MakeEdgeToFaceMap: handle invalid faces with repeating vertices --- light/light2.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/light/light2.cc b/light/light2.cc index 26b4623b..fa2a606b 100644 --- a/light/light2.cc +++ b/light/light2.cc @@ -115,6 +115,11 @@ edgeToFaceMap_t MakeEdgeToFaceMap(const bsp2_t *bsp) { const int v0 = Face_VertexAtIndex(bsp, f, j); const int v1 = Face_VertexAtIndex(bsp, f, (j + 1) % f->numedges); + if (v0 == v1) { + // ad_swampy.bsp has faces with repeated verts... + continue; + } + const auto edge = make_pair(v0, v1); auto &edgeFacesRef = result[edge];