Fix issue where "unbound" without a control name afterward would end up in settings.cfg when dealing with disabled gamefuncs

git-svn-id: https://svn.eduke32.com/eduke32@7548 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-04-09 19:21:29 +00:00 committed by Christoph Oelckers
parent 7e7b06a653
commit e8a401759d

View file

@ -705,7 +705,7 @@ void CONFIG_WriteSettings(void) // save binds and aliases to <cfgname>_settings.
for (int i=0; i<NUMGAMEFUNCTIONS; ++i) for (int i=0; i<NUMGAMEFUNCTIONS; ++i)
{ {
if (ud.config.KeyboardKeys[i][0] == 0xff || !ud.config.KeyboardKeys[i][0]) if (CONFIG_FunctionNumToName(i) && (ud.config.KeyboardKeys[i][0] == 0xff || !ud.config.KeyboardKeys[i][0]))
{ {
buildvfs_fputstr(fp, "unbound "); buildvfs_fputstr(fp, "unbound ");
buildvfs_fputstrptr(fp, CONFIG_FunctionNumToName(i)); buildvfs_fputstrptr(fp, CONFIG_FunctionNumToName(i));