From 43c718af3719c512b32e995b3d27f96df2bf7ecc Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 26 Mar 2025 17:13:54 +0100 Subject: [PATCH] fix bird menu from crashing (again) finally add an enum so this wont happen again --- src/m_menu.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index ff5cb7075..5db91a966 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1163,6 +1163,25 @@ static menuitem_t OP_MainMenu[] = {IT_CALL|IT_STRING, NULL, "Local Skin Options...", M_LocalSkinMenu, 165}, }; +enum +{ + ctrlsetup, + vidopt, + soundopt, + focusopt, + hudopt, + camopt, + gameopt, + serveropt, + dataopt, + addonopt, + tricksandshit, + credits, + satopt, + bird, + localskin +}; + static menuitem_t OP_ControlsMenu[] = { {IT_CALL | IT_STRING, NULL, "Player 1 Controls...", M_Setup1PControlsMenu, 10}, @@ -7959,11 +7978,11 @@ static void M_Options(INT32 choice) (void)choice; // if the player is not admin or server, disable gameplay & server options - OP_MainMenu[5].status = OP_MainMenu[6].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); + OP_MainMenu[gameopt].status = OP_MainMenu[serveropt].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); - OP_MainMenu[10].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); // Play credits + OP_MainMenu[credits].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); // Play credits - OP_MainMenu[13].status = (!cv_showlocalskinmenus.value) ? (IT_DISABLED) : (IT_CALL|IT_STRING); + OP_MainMenu[localskin].status = (!cv_showlocalskinmenus.value) ? (IT_DISABLED) : (IT_CALL|IT_STRING); #ifdef HAVE_DISCORDRPC OP_DataOptionsMenu[4].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); // Erase data @@ -7971,8 +7990,7 @@ static void M_Options(INT32 choice) OP_DataOptionsMenu[3].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); // Erase data #endif - OP_GameOptionsMenu[3].status = - (M_SecretUnlocked(SECRET_ENCORE)) ? (IT_CVAR|IT_STRING) : IT_SECRET; // cv_kartencore + OP_GameOptionsMenu[3].status = (M_SecretUnlocked(SECRET_ENCORE)) ? (IT_CVAR|IT_STRING) : IT_SECRET; // cv_kartencore OP_MainDef.prevMenu = currentMenu; M_SetupNextMenu(&OP_MainDef);