mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
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
This commit is contained in:
parent
d9be00342c
commit
0c68971c13
1 changed files with 2 additions and 13 deletions
|
@ -407,19 +407,8 @@ ScaleFactor Endgame<KBPsK>::operator()(const Position& pos) const {
|
|||
Square kingSq = pos.king_square(weakSide);
|
||||
|
||||
if ( opposite_colors(queeningSq, bishopSq)
|
||||
&& abs(file_of(kingSq) - pawnFile) <= 1)
|
||||
{
|
||||
// The bishop has the wrong color, and the defending king is on the
|
||||
// file of the pawn(s) or the adjacent file. Find the rank of the
|
||||
// frontmost pawn.
|
||||
Square pawnSq = frontmost_sq(strongSide, pawns);
|
||||
|
||||
// If the defending king has distance 1 to the promotion square or
|
||||
// is placed somewhere in front of the pawn, it's a draw.
|
||||
if ( square_distance(kingSq, queeningSq) <= 1
|
||||
|| relative_rank(weakSide, kingSq) <= relative_rank(weakSide, pawnSq))
|
||||
return SCALE_FACTOR_DRAW;
|
||||
}
|
||||
&& square_distance(queeningSq, kingSq) <= 1)
|
||||
return SCALE_FACTOR_DRAW;
|
||||
}
|
||||
|
||||
// All pawns on same B or G file? Then potential draw
|
||||
|
|
Loading…
Add table
Reference in a new issue