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++) {
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];
}
}