From 252bc6b66571fcb0247c8956b8174db83033efe9 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 31 Oct 2020 13:24:43 +0100 Subject: [PATCH] Fix failing assertion in losers chess Prevent non-evasion move generation when in check. --- src/search.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index cafb11a..0878a93 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1202,7 +1202,7 @@ moves_loop: // When in check, search starts from here // Losing chess capture extension else if ( pos.must_capture() && pos.capture(move) - && MoveList(pos).size() == 1) + && (ss->inCheck || MoveList(pos).size() == 1)) extension = 1; // Add extension to new depth @@ -1230,7 +1230,7 @@ moves_loop: // When in check, search starts from here || ss->staticEval + PieceValue[EG][pos.captured_piece()] <= alpha || cutNode || thisThread->ttHitAverage < 427 * TtHitAverageResolution * TtHitAverageWindow / 1024) - && !(pos.must_capture() && MoveList(pos).size())) + && !(pos.must_capture() && (givesCheck || MoveList(pos).size()))) { Depth r = reduction(improving, depth, moveCount); -- 1.7.0.4