From 9e9319667216e94a337006f98fe3c3071210d5ad Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 25 Mar 2025 04:39:58 +0100 Subject: [PATCH] not checking for captures in QS | bench 904927 --- source/search.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 15e2178..b44d797 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -138,22 +138,20 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply) { for (int i = 0; i < board.currentMoveIndex; i++) { if (!board.IsLegal(board.moveList[i])) continue; - if (board.moveList[i].IsCapture()) { - Board copy = board; - copy.MakeMove(board.moveList[i], false); - int score = -Quiescence(copy, -beta, -alpha, ply + 1).score; - positionIndex--; + Board copy = board; + copy.MakeMove(board.moveList[i], false); + int score = -Quiescence(copy, -beta, -alpha, ply + 1).score; + positionIndex--; - if (score >= beta) { - return score; - } + if (score >= beta) { + return score; + } - bestScore = std::max(score, bestScore); + bestScore = std::max(score, bestScore); - if (score > alpha) { - alpha = score; - results.bestMove = board.moveList[i]; - } + if (score > alpha) { + alpha = score; + results.bestMove = board.moveList[i]; } }