mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Fix assert with very high score position
In case of a very high material score, we can overflow VALUE_INFINITE. This patch fixes an assert with: position fen 7k/QQQQR3/2B5/4KN1Q/3QQ3/8/8/4R3 b - - 0 1 go depth 1 No functional change. Resolves #546
This commit is contained in:
parent
a5c76d69c3
commit
3e4fed3a91
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ Value Endgame<KXK>::operator()(const Position& pos) const {
|
|||
||(pos.count<BISHOP>(strongSide) && pos.count<KNIGHT>(strongSide))
|
||||
||(pos.count<BISHOP>(strongSide) > 1 && opposite_colors(pos.squares<BISHOP>(strongSide)[0],
|
||||
pos.squares<BISHOP>(strongSide)[1])))
|
||||
result += VALUE_KNOWN_WIN;
|
||||
result = std::min(result + VALUE_KNOWN_WIN, VALUE_MATE_IN_MAX_PLY - 1);
|
||||
|
||||
return strongSide == pos.side_to_move() ? result : -result;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue