mirror of
https://github.com/nzp-team/quakespasm.git
synced 2025-02-17 00:51:20 +00:00
Merge pull request #38 from tyleryoung88/main
This commit is contained in:
commit
774072a853
1 changed files with 64 additions and 54 deletions
|
@ -1699,6 +1699,7 @@ void Map_Finder(void)
|
|||
DIR* dir;
|
||||
struct dirent* ent;
|
||||
char map_dir[MAX_OSPATH];
|
||||
qboolean breakaway;
|
||||
|
||||
for (int i = 0; i < 50; i++) {
|
||||
custom_maps[i].occupied = false;
|
||||
|
@ -1716,22 +1717,30 @@ void Map_Finder(void)
|
|||
{
|
||||
if(!strcmp(COM_FileGetExtension(ent->d_name),"bsp") || !strcmp(COM_FileGetExtension(ent->d_name),"BSP"))
|
||||
{
|
||||
qboolean breakaway = false;
|
||||
breakaway = false;
|
||||
char ntype[32];
|
||||
COM_StripExtension(ent->d_name, ntype, sizeof(ntype));
|
||||
|
||||
for (int j = 0; j < BASE_MAP_COUNT; j++)
|
||||
{
|
||||
if (breakaway == true)
|
||||
return;
|
||||
break;
|
||||
|
||||
if(!strcmp(ntype, base_maps[j]))
|
||||
{
|
||||
//Con_Printf("ntype: %s\n base_map: %s\n", ntype, base_maps[j]);
|
||||
breakaway = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (breakaway == true)
|
||||
{
|
||||
//Con_Printf("Breaking away at ntype: %s\n", ntype);
|
||||
continue;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//Con_Printf("Success at ntype: %s\n", ntype);
|
||||
custom_maps[user_maps_num].occupied = true;
|
||||
custom_maps[user_maps_num].map_name = malloc(sizeof(char)*32);
|
||||
sprintf(custom_maps[user_maps_num].map_name, "%s", ntype);
|
||||
|
@ -1799,6 +1808,7 @@ void Map_Finder(void)
|
|||
user_maps_num = user_maps_num + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
custom_map_pages = (int)ceil((double)(user_maps_num + 1)/15);
|
||||
|
|
Loading…
Reference in a new issue