From 18c0eca87defa3b1da0be6de0f095ba01d933815 Mon Sep 17 00:00:00 2001 From: rektdie Date: Fri, 23 May 2025 14:05:24 +0200 Subject: [PATCH] fixed cutnode passing | bench 5299823 --- source/search.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 79f6fc2..84fa15e 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -277,7 +277,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC // Always legal so we dont check it ctx.doingNullMove = true; - int score = -PVS(copy, depth - 3, -beta, -beta + 1, ply + 1, ctx, false).score; + int score = -PVS(copy, depth - 3, -beta, -beta + 1, ply + 1, ctx, !cutnode).score; ctx.doingNullMove = false; if (ctx.searchStopped) return 0; @@ -349,11 +349,11 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (score > alpha) { // Null-window search now without the reduction - score = -PVS(copy, newDepth, -alpha-1, -alpha, ply + 1, ctx, true).score; + score = -PVS(copy, newDepth, -alpha-1, -alpha, ply + 1, ctx, !cutnode).score; } } else { // Null-window search - score = -PVS(copy, newDepth, -alpha-1, -alpha, ply + 1, ctx, true).score; + score = -PVS(copy, newDepth, -alpha-1, -alpha, ply + 1, ctx, !cutnode).score; } // Check if we need to do full window re-search