From: Marco Costalba Date: Mon, 6 Jul 2009 08:40:50 +0000 (+0100) Subject: Fix generation of check blocking promotion X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a5fce1958b6dde56a67c7ef656e2b5fe7d3258d4;ds=sidebyside Fix generation of check blocking promotion 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 --- diff --git a/src/movegen.cpp b/src/movegen.cpp index 33da450e..ff8f6c6e 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -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);