Fix endgame evaluation for KFsPs vs. K
authorFabian Fichter <ianfab@users.noreply.github.com>
Mon, 2 Dec 2019 20:48:39 +0000 (21:48 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 2 Dec 2019 20:48:39 +0000 (21:48 +0100)
Example:
```
setoption name UCI_Variant value makruk
position fen 7k/8/5M2/5KMP/8/8/8/8 w - - 0 1
eval
```

src/endgame.cpp

index 8af27b9..a62bfce 100644 (file)
@@ -395,7 +395,7 @@ Value Endgame<KFsPsK>::operator()(const Position& pos) const {
       Bitboard b = pos.pieces(strongSide, PAWN);
       while (b && (!dark || !light))
       {
-          if (file_of(pop_lsb(&b)) % 2 == relative_rank(strongSide, pos.promotion_rank(), pos.max_rank()) % 2)
+          if (file_of(pop_lsb(&b)) % 2 != relative_rank(strongSide, pos.promotion_rank(), pos.max_rank()) % 2)
               light = true;
           else
               dark = true;