not checking for captures in QS | bench 904927

This commit is contained in:
rektdie committed 2025-03-25 04:39:58 +01:00
1 parent 99f556e29d
commit 9e93196672
1 file changed
+11 -13
+11 -13
View File
@@ -138,22 +138,20 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply) {
for (int i = 0; i < board.currentMoveIndex; i++) { for (int i = 0; i < board.currentMoveIndex; i++) {
if (!board.IsLegal(board.moveList[i])) continue; if (!board.IsLegal(board.moveList[i])) continue;
if (board.moveList[i].IsCapture()) { Board copy = board;
Board copy = board; copy.MakeMove(board.moveList[i], false);
copy.MakeMove(board.moveList[i], false); int score = -Quiescence(copy, -beta, -alpha, ply + 1).score;
int score = -Quiescence(copy, -beta, -alpha, ply + 1).score; positionIndex--;
positionIndex--;
if (score >= beta) { if (score >= beta) {
return score; return score;
} }
bestScore = std::max(score, bestScore); bestScore = std::max(score, bestScore);
if (score > alpha) { if (score > alpha) {
alpha = score; alpha = score;
results.bestMove = board.moveList[i]; results.bestMove = board.moveList[i];
}
} }
} }