From 92b08ac08fd555fee90402509284bf79b7d37070 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 30 Jul 2012 22:04:53 +0200 Subject: [PATCH] RULES_PASS_STONES: Correctly support undo --- board.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board.c b/board.c index aa69f21..2f72122 100644 --- a/board.c +++ b/board.c @@ -1388,6 +1388,10 @@ int board_undo(struct board *board) { if (!is_pass(board->last_move.coord)) return -1; + if (board->rules == RULES_PASS_STONES) { + /* Return pass stone to the passing player. */ + board->captures[stone_other(board->last_move.color)]--; + } board->last_move = board->last_move2; board->last_move2 = board->last_move3; board->last_move3 = board->last_move4; -- 2.11.4.GIT