From d6a17d022c2156b5359a9a9cac47848c04238dec Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 15 Dec 2021 22:43:21 -0700 Subject: [PATCH] qbsp: CreateBrushFaces: fix accessing empty winding in `w->clip(...)` expression --- qbsp/brush.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qbsp/brush.cc b/qbsp/brush.cc index a806240f..e252c9cd 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -330,6 +330,8 @@ static face_t *CreateBrushFaces(const mapentity_t *src, hullbrush_t *hullbrush, for (auto &mapface2 : hullbrush->faces) { if (&mapface == &mapface2) continue; + if (!w) + break; // flip the plane, because we want to keep the back side plane = -mapface2.plane;