From c7015183c44779446e8bed78f24f79982b0a0a92 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 21 Feb 2023 17:13:35 -0500 Subject: [PATCH] Stop drawing menu maps as custom maps in Quakespasm --- source/menu.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/source/menu.c b/source/menu.c index e34bd5e..f05e157 100644 --- a/source/menu.c +++ b/source/menu.c @@ -107,6 +107,14 @@ typedef struct usermap_t custom_maps[50]; +#define BASE_MAP_COUNT 3 +char* base_maps [] = +{ + "ndu", + "warehouse", + "christmas_special" +}; + enum m_state_e m_state; int old_m_state; @@ -1706,9 +1714,24 @@ void Map_Finder(void) { while ((ent = readdir(dir))) { - if(!strcmp(COM_FileGetExtension(ent->d_name),"bsp") || !strcmp(COM_FileGetExtension(ent->d_name),"BSP")) { + if(!strcmp(COM_FileGetExtension(ent->d_name),"bsp") || !strcmp(COM_FileGetExtension(ent->d_name),"BSP")) + { + qboolean 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; + + if(!strcmp(ntype, base_maps[j])) + breakaway = true; + } + + if (breakaway == true) + continue; + 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);