From bb0faada7f4841ae768be4633712c9f82ae0f654 Mon Sep 17 00:00:00 2001 From: bottiger1 <55270538+bottiger1@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:29:22 -0700 Subject: [PATCH] fix vbsp: drop overlays bound to brush entities info_overlay faces on a brush entity (func_*) bake an overlay lump the engine resolves against the world brush, crashing clients on map load. Only emit overlay->face bindings for world geometry (entity_num 0). --- src/utils/vbsp/writebsp.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/utils/vbsp/writebsp.cpp b/src/utils/vbsp/writebsp.cpp index c3bc09d6d69..71b3abbd5e5 100644 --- a/src/utils/vbsp/writebsp.cpp +++ b/src/utils/vbsp/writebsp.cpp @@ -520,16 +520,27 @@ void EmitFace( face_t *f, qboolean onNode ) side_t *pSide = f->originalface; if ( pSide ) { - int nOverlayCount = pSide->aOverlayIds.Count(); - if ( nOverlayCount > 0 ) + // Overlays are only supported on world geometry (model 0). Binding one to + // a brush entity (entity_num != 0) bakes a face the engine resolves against + // the world brush, crashing clients on map load -- drop it instead. + if ( entity_num != 0 && + ( pSide->aOverlayIds.Count() > 0 || pSide->aWaterOverlayIds.Count() > 0 ) ) { - Overlay_AddFaceToLists( ( numfaces - 1 ), pSide ); + Warning( "Overlay on brush entity %d skipped (overlays only work on world geometry).\n", entity_num ); } - - nOverlayCount = pSide->aWaterOverlayIds.Count(); - if ( nOverlayCount > 0 ) + else { - OverlayTransition_AddFaceToLists( ( numfaces - 1 ), pSide ); + int nOverlayCount = pSide->aOverlayIds.Count(); + if ( nOverlayCount > 0 ) + { + Overlay_AddFaceToLists( ( numfaces - 1 ), pSide ); + } + + nOverlayCount = pSide->aWaterOverlayIds.Count(); + if ( nOverlayCount > 0 ) + { + OverlayTransition_AddFaceToLists( ( numfaces - 1 ), pSide ); + } } } }