Fix Pawn double-push
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 28 Feb 2014 09:43:08 +0000 (10:43 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Fri, 28 Feb 2014 09:43:08 +0000 (10:43 +0100)
Black pawns also did double-pushes from the 6th rank!

hachu.c

diff --git a/hachu.c b/hachu.c
index f457569..d341352 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -1122,7 +1122,7 @@ GenNonCapts (int promoSuppress)
          }\r
        } else\r
        if(r == M) { // FIDE Pawn; check double-move\r
-         if(!NewNonCapture(x, x+v, pFlag) && chessFlag && promoBoard[x-v])\r
+         if(!NewNonCapture(x, x+v, pFlag) && chessFlag && promoBoard[x-v] & LAST_RANK)\r
            NewNonCapture(x, x+2*v, pFlag), moveStack[msp-1] |= DEFER; // use promoSuppress flag as e.p. flag\r
        }\r
        continue;\r