From 68a7689108cd2ad0cab94a7d012b96386aff82dc Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 23 Dec 2025 14:05:36 +0500 Subject: [PATCH] engine: client: fix incorrect usage of Mod_TestBmodelLumps return value in Cmd_ListMaps, causing it to crash --- engine/common/con_utils.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engine/common/con_utils.c b/engine/common/con_utils.c index 7f3ff54f..702bb625 100644 --- a/engine/common/con_utils.c +++ b/engine/common/con_utils.c @@ -86,13 +86,15 @@ int Cmd_ListMaps( search_t *t, char *lastmapname, size_t len ) filelen = FS_Read( f, buf, sizeof( buf )); // check all the lumps and some other errors - if( Mod_TestBmodelLumps( f, t->filenames[i], buf, filelen, true, &entities )) + if( !Mod_TestBmodelLumps( f, t->filenames[i], buf, filelen, true, &entities )) { - lumpofs = entities.fileofs; - lumplen = entities.filelen; - ver = header->version; + FS_Close( f ); + continue; } + lumpofs = entities.fileofs; + lumplen = entities.filelen; + header = (dheader_t *)buf; hdrext = (dextrahdr_t *)((byte *)buf + sizeof( dheader_t ));