X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/875286b30ed0217383fc8aed8cfa39b506146be7..392ee62ca6a0a64356e9a874100c981f70b8611a:/client.c diff --git a/client.c b/client.c index 6c45fc3..98b9542 100644 --- a/client.c +++ b/client.c @@ -325,9 +325,9 @@ void CheckClears(int scr) void OneGame(void) { - int changed = 0; + bool changed = 0; short gameStatus = 2; //2=loop; 1=new piece; 0=quit - int chatMode = 0; + bool chatMode = 0; char chatText[MSG_WIDTH] = "\0"; void handle_cmd(char cmd, char *arg) @@ -420,7 +420,7 @@ void OneGame(void) if (!(p = strchr(keyTable, tolower(key)))) return; key = p - keyTable; - bool handle_key(char key) + void handle_keycmd(char key) { switch (key) { case KT_redraw: @@ -428,23 +428,18 @@ void OneGame(void) InitFields(); // ScheduleFullRedraw(); refresh(); - return 1; + return; case KT_say: chatMode = 1; Messagetype(key, strlen(chatText) - 1, chatText); - return 1; + return; case KT_quit: handle_cmd(CT_quit, NULL); - return 1; + return; case KT_pause: handle_cmd(CT_pause, NULL); - return 1; - default: - return 0; + return; } - } - // global actions (always possible, even if not playing) - if (handle_key(key)) return; if (Players[me].alive <= 0 || paused) return; // actions only available while actually playing @@ -493,7 +488,8 @@ void OneGame(void) changed = 1; break; } - return; + } + handle_keycmd(key); } //GameKey int oldPaused = 0;