Skip to content

Commit

Permalink
Only list PAK BSPs in maps dir
Browse files Browse the repository at this point in the history
e.g. filter out AD's maps/bmodels or maps/xxx_brk
  • Loading branch information
andrei-drexler committed Sep 4, 2022
1 parent f776863 commit 65479e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Quake/host_cmd.c
Expand Up @@ -187,13 +187,13 @@ void ExtraMaps_Init (void)
{ //don't list standard id maps
for (i = 0, pak = search->pack; i < pak->numfiles; i++)
{
if (!strcmp(COM_FileGetExtension(pak->files[i].name), "bsp"))
if (pak->files[i].filelen > 32*1024 && // don't list files under 32k (ammo boxes etc)
!strncmp (pak->files[i].name, "maps/", 5) && // don't list files outside of maps/
!strchr (pak->files[i].name + 5, '/') && // don't list files in subdirectories
!strcmp (COM_FileGetExtension (pak->files[i].name), "bsp"))
{
if (pak->files[i].filelen > 32*1024)
{ // don't list files under 32k (ammo boxes etc)
COM_StripExtension(pak->files[i].name + 5, mapname, sizeof(mapname));
ExtraMaps_Add (mapname);
}
COM_StripExtension(pak->files[i].name + 5, mapname, sizeof(mapname));
ExtraMaps_Add (mapname);
}
}
}
Expand Down

0 comments on commit 65479e8

Please sign in to comment.