X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fendgame.cpp;h=3e01259c9745b01d90c0e9731f5bf2a6727fdf20;hp=55e4483dbe84a22c0d456b2a2994fc7e0256ca3d;hb=2ac35027d5900a641559fae7b22a994f8b4c2d72;hpb=759b3c79cf94d101163f646b1eb2a9f9c64293ab diff --git a/src/endgame.cpp b/src/endgame.cpp index 55e4483d..3e01259c 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -214,7 +214,7 @@ Value Endgame::operator()(const Position& pos) const { Value result; // If the stronger side's king is in front of the pawn, it's a win - if (wksq < psq && file_of(wksq) == file_of(psq)) + if (forward_file_bb(WHITE, wksq) & psq) result = RookValueEg - distance(wksq, psq); // If the weaker side's king is too far from the pawn and the rook, @@ -631,29 +631,8 @@ ScaleFactor Endgame::operator()(const Position& pos) const { // Case 2: Opposite colored bishops if (opposite_colors(strongBishopSq, weakBishopSq)) - { - // We assume that the position is drawn in the following three situations: - // - // a. The pawn is on rank 5 or further back. - // b. The defending king is somewhere in the pawn's path. - // c. The defending bishop attacks some square along the pawn's path, - // and is at least three squares away from the pawn. - // - // These rules are probably not perfect, but in practice they work - // reasonably well. - - if (relative_rank(strongSide, pawnSq) <= RANK_5) - return SCALE_FACTOR_DRAW; - - Bitboard path = forward_file_bb(strongSide, pawnSq); - - if (path & pos.pieces(weakSide, KING)) - return SCALE_FACTOR_DRAW; + return SCALE_FACTOR_DRAW; - if ( (pos.attacks_from(weakBishopSq) & path) - && distance(weakBishopSq, pawnSq) >= 3) - return SCALE_FACTOR_DRAW; - } return SCALE_FACTOR_NONE; }