missed bestScore in QS move loop | bench 4110983

This commit is contained in:
rektdie committed 2025-03-09 05:26:02 +01:00
1 parent ec9c2e7348
commit f29a0761a9
1 file changed
+9 -3
+9 -3
View File
@@ -96,11 +96,15 @@ static SearchResults Quiescence(Board board, int alpha, int beta) {
int staticScore = Evaluate(board);
if (staticScore >= beta) {
return staticScore;
int bestScore = staticScore;
if (bestScore>= beta) {
return bestScore;
}
int bestScore = staticScore;
if (alpha < bestScore) {
alpha = bestScore;
}
GenerateMoves(board, board.sideToMove);
@@ -118,6 +122,8 @@ static SearchResults Quiescence(Board board, int alpha, int beta) {
return score;
}
bestScore = std::max(score, bestScore);
if (score > alpha) {
alpha = score;
results.bestMove = board.moveList[i];