Skip to content

Commit 0c68971

Browse files
ceebomcostalba
authored andcommitted
Remove a drawing rule from KBPsK function
The rule can be incorrect if the attacking king is well placed e.g. 8/6K1/8/8/7k/1B6/7P/8 w - - 0 1 bench: 8279065
1 parent d9be003 commit 0c68971

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/endgame.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -407,19 +407,8 @@ ScaleFactor Endgame<KBPsK>::operator()(const Position& pos) const {
407407
Square kingSq = pos.king_square(weakSide);
408408

409409
if ( opposite_colors(queeningSq, bishopSq)
410-
&& abs(file_of(kingSq) - pawnFile) <= 1)
411-
{
412-
// The bishop has the wrong color, and the defending king is on the
413-
// file of the pawn(s) or the adjacent file. Find the rank of the
414-
// frontmost pawn.
415-
Square pawnSq = frontmost_sq(strongSide, pawns);
416-
417-
// If the defending king has distance 1 to the promotion square or
418-
// is placed somewhere in front of the pawn, it's a draw.
419-
if ( square_distance(kingSq, queeningSq) <= 1
420-
|| relative_rank(weakSide, kingSq) <= relative_rank(weakSide, pawnSq))
421-
return SCALE_FACTOR_DRAW;
422-
}
410+
&& square_distance(queeningSq, kingSq) <= 1)
411+
return SCALE_FACTOR_DRAW;
423412
}
424413

425414
// All pawns on same B or G file? Then potential draw

0 commit comments

Comments
 (0)