diff --git a/src/search.cpp b/src/search.cpp index 5d55830d9df..fbed32c84f8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -302,6 +302,10 @@ void Thread::search() { multiPV = std::min(multiPV, rootMoves.size()); + int contempt = Options["Contempt"] * PawnValueEg / 100; // From centipawns + Eval::Contempt = (rootPos.side_to_move() == WHITE ? make_score(contempt, contempt / 2) + : -make_score(contempt, contempt / 2)); + // Iterative deepening loop until requested to stop or the target depth is reached while ( (rootDepth += ONE_PLY) < DEPTH_MAX && !Threads.stop @@ -338,7 +342,7 @@ void Thread::search() { beta = std::min(rootMoves[PVIdx].previousScore + delta, VALUE_INFINITE); // Adjust contempt based on current situation - int contempt = Options["Contempt"] * PawnValueEg / 100 + bestValue/10; // From centipawns + contempt = Options["Contempt"] * PawnValueEg / 100 + bestValue/10; // From centipawns Eval::Contempt = (rootPos.side_to_move() == WHITE ? make_score(contempt, contempt / 2) : -make_score(contempt, contempt / 2));