keys.c: Allow SetBinding() to really clear a key, instead of binding it to the empty string.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1087 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Sander van Dijk 2014-10-05 20:48:27 +00:00
parent 5ca58d55b0
commit 0c28e5a03e
2 changed files with 5 additions and 4 deletions

View file

@ -612,7 +612,8 @@ void Key_SetBinding (int keynum, const char *binding)
}
// allocate memory for new binding
keybindings[keynum] = Z_Strdup(binding);
if (binding)
keybindings[keynum] = Z_Strdup(binding);
}
/*
@ -637,7 +638,7 @@ void Key_Unbind_f (void)
return;
}
Key_SetBinding (b, "");
Key_SetBinding (b, NULL);
}
void Key_Unbindall_f (void)
@ -647,7 +648,7 @@ void Key_Unbindall_f (void)
for (i = 0; i < MAX_KEYS; i++)
{
if (keybindings[i])
Key_SetBinding (i, "");
Key_SetBinding (i, NULL);
}
}

View file

@ -1377,7 +1377,7 @@ void M_UnbindCommand (const char *command)
if (!b)
continue;
if (!strncmp (b, command, l) )
Key_SetBinding (j, "");
Key_SetBinding (j, NULL);
}
}