# HG changeset patch # User Mike Becker # Date 1397678273 -7200 # Node ID 21cb830efe91d83e941b6f7dc4cda17b8ff70eeb # Parent a8346dcf7bbf8e174b5456bf56a5e9cd703fa914 fixed bug where an invalid network response lead to an accepted move diff -r a8346dcf7bbf -r 21cb830efe91 src/game.c --- a/src/game.c Wed Apr 16 21:46:34 2014 +0200 +++ b/src/game.c Wed Apr 16 21:57:53 2014 +0200 @@ -296,7 +296,10 @@ gamestate->stalemate = code == NETCODE_STALEMATE; if (code == NETCODE_DECLINE) { printw("Invalid move."); - } else { + } else if (code == NETCODE_ACCEPT + || code == NETCODE_CHECK + || code == NETCODE_CHECKMATE + || code == NETCODE_STALEMATE) { apply_move(gamestate, &move); if (gamestate->checkmate) { printw("Checkmate!"); @@ -309,6 +312,8 @@ } else { return 0; } + } else { + printw("Invalid network response."); } break; default: