Fix a bug with undefinegamefunc breaking the key configuration menu.

git-svn-id: https://svn.eduke32.com/eduke32@6350 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-07-10 13:43:54 +00:00
parent c980410ecc
commit ebe2e67439

View file

@ -1561,22 +1561,23 @@ void Menu_Init(void)
} }
// prepare input // prepare input
k = 0;
for (i = 0; i < NUMGAMEFUNCTIONS; ++i) for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
{ {
if (MenuGameFuncs[i][0] == '\0') if (MenuGameFuncs[i][0] == '\0')
{
MEL_KEYBOARDSETUPFUNCS[i] = NULL;
continue; continue;
}
MEL_KEYBOARDSETUPFUNCS[k] = &ME_KEYBOARDSETUPFUNCS[k]; MEL_KEYBOARDSETUPFUNCS[i] = &ME_KEYBOARDSETUPFUNCS[i];
ME_KEYBOARDSETUPFUNCS[k] = ME_KEYBOARDSETUPFUNCS_TEMPLATE; ME_KEYBOARDSETUPFUNCS[i] = ME_KEYBOARDSETUPFUNCS_TEMPLATE;
ME_KEYBOARDSETUPFUNCS[k].name = MenuGameFuncs[i]; ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
ME_KEYBOARDSETUPFUNCS[k].entry = &MEO_KEYBOARDSETUPFUNCS[k]; ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
MEO_KEYBOARDSETUPFUNCS[k] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE; MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
MEO_KEYBOARDSETUPFUNCS[k].column[0] = &ud.config.KeyboardKeys[i][0]; MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
MEO_KEYBOARDSETUPFUNCS[k].column[1] = &ud.config.KeyboardKeys[i][1]; MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
++k;
} }
M_KEYBOARDKEYS.numEntries = k; M_KEYBOARDKEYS.numEntries = NUMGAMEFUNCTIONS;
for (i = 0; i < MENUMOUSEFUNCTIONS; ++i) for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
{ {
MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i]; MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i];