engine: client: fix incorrect usage of Mod_TestBmodelLumps return value in Cmd_ListMaps, causing it to crash

This commit is contained in:
Alibek Omarov
2025-12-23 14:05:36 +05:00
parent 58996c3d0d
commit 68a7689108

View File

@@ -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 ));