From bd3f865cf71c0dc1ed3bae5a8538b9ef51d11376 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 5 Apr 2026 05:23:01 +0500 Subject: [PATCH] engine: mod_bmodel: only look for BSPX lumps if BSPX header was found --- engine/common/mod_bmodel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 6e31fcb6..980956e9 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -3878,8 +3878,11 @@ static qboolean Mod_LoadBmodelLumps( model_t *mod, byte *mod_base, size_t buffer Mod_LoadLump( mod_base, &extlumps[i], &worldstats[stat_index], flags, LOADLUMP_BSP30EXT, NULL ); // loading bspx lumps - for( i = 0; i < ARRAYSIZE( bspxlumps ); i++, stat_index++ ) - Mod_LoadLump( mod_base, &bspxlumps[i], &worldstats[stat_index], flags, LOADLUMP_BSPX, mod_base + bspx_header_offset ); + if( bspx_header_offset >= 0 ) + { + for( i = 0; i < ARRAYSIZE( bspxlumps ); i++, stat_index++ ) + Mod_LoadLump( mod_base, &bspxlumps[i], &worldstats[stat_index], flags, LOADLUMP_BSPX, mod_base + bspx_header_offset ); + } if( !bmod->isworld ) // a1ba: why world excluded here? {