X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/f281a885d14a7d110b222ada3659ba36adcc2c84..ddbae5789635a63fcf36a84056f9df4bc8b6adaa:/client.c diff --git a/client.c b/client.c index 9c228d8..6110445 100644 --- a/client.c +++ b/client.c @@ -21,6 +21,7 @@ #include "netris.h" #include +#include #include #include #include @@ -425,21 +426,28 @@ void OneGame(void) if (!(p = strchr(keyTable, tolower(key)))) return; key = p - keyTable; - // global actions (always possible, even if not playing) + bool handle_key(char key) + { switch (key) { case KT_redraw: clear(); InitFields(); // ScheduleFullRedraw(); refresh(); - return; + return 1; case KT_say: chatMode = 1; Messagetype(key, strlen(chatText) - 1, chatText); - return; + return 1; case KT_quit: - return handle_cmd(CT_quit, NULL); + handle_cmd(CT_quit, NULL); + return 1; + default: + return 0; } + } + // global actions (always possible, even if not playing) + if (handle_key(key)) return; if (Players[me].alive <= 0) return; // actions available while in game