Skip king safety evaluation if checking is illegal
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 2 Sep 2018 15:10:00 +0000 (17:10 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 6 Sep 2018 18:42:57 +0000 (20:42 +0200)
STC racingkings
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 120 W: 106 L: 10 D: 4
http://35.161.250.236:6543/tests/view/5b8bfdd66e23db0fbab0dd3f

src/evaluate.cpp

index 69a9ca4..e9307df 100644 (file)
@@ -427,7 +427,7 @@ namespace {
     constexpr Bitboard Camp = (Us == WHITE ? AllSquares ^ Rank6BB ^ Rank7BB ^ Rank8BB
                                            : AllSquares ^ Rank1BB ^ Rank2BB ^ Rank3BB);
 
-    if (!pos.count<KING>(Us))
+    if (!pos.count<KING>(Us) || !pos.checking_permitted())
         return SCORE_ZERO;
 
     const Square ksq = pos.square<KING>(Us);