From e3fcdcf378afd1a9be2ebfe597c4b4de42fd8566 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 5 Apr 2008 12:19:17 +0000 Subject: [PATCH] fixed console bind problem --- src/game/client/gc_console.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/game/client/gc_console.cpp b/src/game/client/gc_console.cpp index 90fc8afc7..935aac919 100644 --- a/src/game/client/gc_console.cpp +++ b/src/game/client/gc_console.cpp @@ -456,20 +456,8 @@ bool console_input_cli(INPUT_EVENT e, void *user_data) return true; } -bool console_input_special_binds(INPUT_EVENT e, void *user_data) +static bool console_execute_event(INPUT_EVENT e) { - // only handle function keys - if(e.key < KEY_F1 || e.key > KEY_F25) - return false; - return console_input_normal_binds(e, user_data); -} - -bool console_input_normal_binds(INPUT_EVENT e, void *user_data) -{ - // need to be ingame for these binds - if(client_state() != CLIENTSTATE_ONLINE) - return false; - // don't handle invalid events and keys that arn't set to anything if(e.key <= 0 || e.key >= KEY_LAST || keybindings[e.key][0] == 0) return false; @@ -481,6 +469,22 @@ bool console_input_normal_binds(INPUT_EVENT e, void *user_data) return true; } +bool console_input_special_binds(INPUT_EVENT e, void *user_data) +{ + // only handle function keys + if(e.key < KEY_F1 || e.key > KEY_F25) + return false; + return console_execute_event(e); +} + +bool console_input_normal_binds(INPUT_EVENT e, void *user_data) +{ + // need to be ingame for these binds + if(client_state() != CLIENTSTATE_ONLINE) + return false; + return console_execute_event(e); +} + void console_toggle(int type) { if(console_type != type && (console_state == CONSOLE_OPEN || console_state == CONSOLE_OPENING))