X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/a88dab379119d15516514e553cac8766cbb54223..355a2c593460a17ffc1502062c415300a94bc639:/client.c diff --git a/client.c b/client.c index 9c228d8..47916fc 100644 --- a/client.c +++ b/client.c @@ -21,6 +21,7 @@ #include "netris.h" #include +#include #include #include #include @@ -345,6 +346,7 @@ void OneGame(void) gameStatus = 0; return; case CT_pause: + if (Players[me].alive <= 0) return; Players[me].flags ^= SCF_paused; if (Game.started > 1) Message(Players[me].flags & SCF_paused @@ -425,30 +427,36 @@ 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 switch (key) { case KT_pause: return handle_cmd(CT_pause, NULL); } - if (paused) return; + if (Players[me].alive <= 0 || paused) return; // actions only available while actually playing switch (key) { case KT_left: