Fix premature disappearence of Lion victims
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 2 Nov 2014 14:52:25 +0000 (15:52 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 7 May 2015 18:53:31 +0000 (20:53 +0200)
The check test did not correctly undo a Lion e.p. capture, which
would make the victim already disappear after entry of the first leg,
which potentially could affect the second leg move generation.
(Not in Lions, though, but in Betza castlings it manifested itself.)

moves.c

diff --git a/moves.c b/moves.c
index dbc8f41..f906bff 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -1698,7 +1698,7 @@ CheckTest (Board board, int flags, int rf, int ff, int rt, int ft, int enPassant
            board[rf][ft] = captured;
            board[rt][ft] = EmptySquare;
        } else {
-           if(saveKill >= 0) board[killY][killX] = trampled, killX = saveKill;
+           if(saveKill >= 0) board[killY][killX = saveKill] = trampled;
            board[rt][ft] = captured;
        }
        board[EP_STATUS] = ep;