Skip empty gametypes in level select menu

This commit is contained in:
fickleheart 2020-02-24 10:02:36 -06:00
parent 0770f77371
commit 1848ce4b97

View file

@ -5045,6 +5045,17 @@ static boolean M_SetNextMapOnPlatter(void)
}
#endif
static boolean M_GametypeHasLevels(INT32 gt)
{
INT32 mapnum;
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
if (M_CanShowLevelOnPlatter(mapnum, gt))
return true;
return false;
}
static INT32 M_CountRowsToShowOnPlatter(INT32 gt)
{
INT32 mapnum = 0, prevmapnum = 0, col = 0, rows = 0;
@ -5362,7 +5373,9 @@ static void M_HandleLevelPlatter(INT32 choice)
case KEY_RIGHTARROW:
if (levellistmode == LLM_CREATESERVER && !lsrow)
{
CV_AddValue(&cv_newgametype, 1);
do
CV_AddValue(&cv_newgametype, 1);
while (!M_GametypeHasLevels(cv_newgametype.value));
S_StartSound(NULL,sfx_menu1);
lscol = 0;
@ -5391,7 +5404,9 @@ static void M_HandleLevelPlatter(INT32 choice)
case KEY_LEFTARROW:
if (levellistmode == LLM_CREATESERVER && !lsrow)
{
CV_AddValue(&cv_newgametype, -1);
do
CV_AddValue(&cv_newgametype, -1);
while (!M_GametypeHasLevels(cv_newgametype.value));
S_StartSound(NULL,sfx_menu1);
lscol = 0;