X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fendgame.cpp;h=24c8c5d41c344dd3cd501d6e955024eb7988ff17;hp=1be384410b4d4a59091528826880a3f80f668b83;hb=ea2b8a93eb3cf2765e51d33ecf37c3994eacb84d;hpb=9b1d5bd5343540db412c50ae2944246e3f25d18b diff --git a/src/endgame.cpp b/src/endgame.cpp index 1be38441..24c8c5d4 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -152,7 +152,10 @@ Value EvaluationFunction::apply(const Position& pos) const { Square loserKSq = pos.king_square(weakerSide); Square bishopSquare = pos.piece_list(strongerSide, BISHOP, 0); - if (same_color_squares(bishopSquare, SQ_A1)) + // kbnk_mate_table() tries to drive toward corners A1 or H8, + // if we have a bishop that cannot reach the above squares we + // mirror the kings so to drive enemy toward corners A8 or H1. + if (!same_color_squares(bishopSquare, SQ_A1)) { winnerKSq = flop_square(winnerKSq); loserKSq = flop_square(loserKSq);