X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fendgame.cpp;h=f1f29d61249371f9302d51d4c93ae3049489991d;hp=5e021f1132917aa36d397a1f090f71938c72cb99;hb=ef0496ff4095330eaea4b33bb14e0386942fd093;hpb=c2fc80e5d16339266b5bf6687fa843ff65de3b3e diff --git a/src/endgame.cpp b/src/endgame.cpp index 5e021f11..f1f29d61 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -410,7 +410,7 @@ ScaleFactor Endgame::operator()(const Position& pos) const { File pawnFile = file_of(pos.piece_list(strongerSide, PAWN)[0]); // All pawns are on a single rook file ? - if ( (pawnFile == FILE_A || pawnFile == FILE_H) + if ( (pawnFile == FILE_A || pawnFile == FILE_H) && !(pawns & ~file_bb(pawnFile))) { Square bishopSq = pos.piece_list(strongerSide, BISHOP)[0]; @@ -650,7 +650,7 @@ ScaleFactor Endgame::operator()(const Position& pos) const { { // Does the defending king block the pawns? if ( square_distance(ksq, relative_square(strongerSide, SQ_A8)) <= 1 - || ( file_of(ksq) == FILE_A + || ( file_of(ksq) == FILE_A && !in_front_bb(strongerSide, ksq) & pawns)) return SCALE_FACTOR_DRAW; } @@ -659,7 +659,7 @@ ScaleFactor Endgame::operator()(const Position& pos) const { { // Does the defending king block the pawns? if ( square_distance(ksq, relative_square(strongerSide, SQ_H8)) <= 1 - || ( file_of(ksq) == FILE_H + || ( file_of(ksq) == FILE_H && !in_front_bb(strongerSide, ksq) & pawns)) return SCALE_FACTOR_DRAW; } @@ -710,7 +710,7 @@ ScaleFactor Endgame::operator()(const Position& pos) const { return SCALE_FACTOR_DRAW; else { - Bitboard path = squares_in_front_of(strongerSide, pawnSq); + Bitboard path = forward_bb(strongerSide, pawnSq); if (path & pos.pieces(KING, weakerSide)) return SCALE_FACTOR_DRAW;