From: Fabian Fichter Date: Wed, 20 May 2020 18:23:14 +0000 (+0200) Subject: Last check is always safe in nCheck X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ad769b5f245a927575871db551616b3e2fc838a8;p=fairystockfish.git Last check is always safe in nCheck 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 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 7ff091f..27a3b59 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));