]> git.sesse.net Git - stockfish/commitdiff
Fix generation of check blocking promotion
authorMarco Costalba <mcostalba@gmail.com>
Mon, 6 Jul 2009 08:40:50 +0000 (09:40 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 6 Jul 2009 08:41:22 +0000 (09:41 +0100)
A promotion move is not considered a possible evasion as it could be.

Bug introduced by patch

Convert also generate_pawn_blocking_evasions() to new API (7/5/2009)

Bug spotted by Kenny Dail.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movegen.cpp

index 33da450ec8e0452eb90daafed75df7cd91740ec1..ff8f6c6e16f6f2f186e27dad9972f43b8cf9bb1f 100644 (file)
@@ -864,7 +864,7 @@ namespace {
                                              Bitboard blockSquares, MoveStack* mlist) {
 
     // Calculate our parametrized parameters at compile time
-    const Bitboard TRank8BB = (Us == WHITE ? Rank8BB : Rank1BB);
+    const Rank TRANK_8 = (Us == WHITE ? RANK_8 : RANK_1);
     const Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);
     const SquareDelta TDELTA_N = (Us == WHITE ? DELTA_N : DELTA_S);
 
@@ -882,7 +882,7 @@ namespace {
 
         assert(pos.piece_on(to) == EMPTY);
 
-        if (square_rank(to) == TRank8BB)
+        if (square_rank(to) == TRANK_8)
         {
             (*mlist++).move = make_promotion_move(to - TDELTA_N, to, QUEEN);
             (*mlist++).move = make_promotion_move(to - TDELTA_N, to, ROOK);