Last check is always safe in nCheck
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 20 May 2020 18:23:14 +0000 (20:23 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 20 May 2020 18:23:14 +0000 (20:23 +0200)
3check STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 3395 W: 1655 L: 1510 D: 230
http://www.variantfishtest.org:6543/tests/view/5ec387cb6e23db36d55f2b99

3check LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 2058 W: 993 L: 870 D: 195
http://www.variantfishtest.org:6543/tests/view/5ec3f7d76e23db36d55f2b9e

karouk STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 260 W: 160 L: 67 D: 33
http://www.variantfishtest.org:6543/tests/view/5ec3f7a26e23db36d55f2b9c

karouk LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 227 W: 150 L: 55 D: 22
http://www.variantfishtest.org:6543/tests/view/5ec3feaf6e23db36d55f2ba0

src/evaluate.cpp

index 7ff091f..27a3b59 100644 (file)
@@ -474,6 +474,7 @@ namespace {
 
     // Analyse the safe enemy's checks which are possible on next move
     safe  = ~pos.pieces(Them);
+    if (!pos.check_counting() || pos.checks_remaining(Them) > 1)
     safe &= ~attackedBy[Us][ALL_PIECES] | (weak & attackedBy2[Them]);
 
     b1 = attacks_bb<ROOK  >(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));