Merge pull request #38 from tyleryoung88/main

This commit is contained in:
Ian 2023-03-02 15:36:04 -05:00 committed by GitHub
commit 774072a853
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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