Wed, 16 Apr 2014 21:57:53 +0200
fixed bug where an invalid network response lead to an accepted move
src/game.c | file | annotate | diff | comparison | revisions |
--- 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: