]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Fix generation of check blocking promotion
[stockfish] / 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);