Fix clearing keys for control in Team Arena UI

When a control is selected for binding a key, pressing backspace would
clear the displayed keys in the menu but not actually unbind the keys.
This commit is contained in:
Zack Middleton 2018-04-26 11:40:16 -05:00
parent 1caf1fb875
commit 45f8512f8e

View file

@ -3547,8 +3547,14 @@ qboolean Item_Bind_HandleKey(itemDef_t *item, int key, qboolean down) {
case K_BACKSPACE:
id = BindingIDFromName(item->cvar);
if (id != -1) {
g_bindings[id].bind1 = -1;
g_bindings[id].bind2 = -1;
if( g_bindings[id].bind1 != -1 ) {
DC->setBinding( g_bindings[id].bind1, "" );
g_bindings[id].bind1 = -1;
}
if( g_bindings[id].bind2 != -1 ) {
DC->setBinding( g_bindings[id].bind2, "" );
g_bindings[id].bind2 = -1;
}
}
Controls_SetConfig(qtrue);
g_waitingForKey = qfalse;