X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=3f5be1a38efe7fb8f823fcf2bda610aa211f64b7;hp=e3030490863f4289df4439ce287a4306bc297262;hb=6b909b2343190f2989d21c8f69f40e9f09c530c0;hpb=10184748533195e4a76a7283b9f9048db05c6fc4 diff --git a/src/search.cpp b/src/search.cpp index e3030490..3f5be1a3 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -42,6 +42,7 @@ namespace Search { LimitsType Limits; std::vector RootMoves; Position RootPosition; + Color RootColor; Time::point SearchTime; StateStackPtr SetupStates; } @@ -174,7 +175,7 @@ void Search::think() { Position& pos = RootPosition; Chess960 = pos.is_chess960(); - Eval::RootColor = pos.side_to_move(); + RootColor = pos.side_to_move(); TimeMgr.init(Limits, pos.startpos_ply_counter(), pos.side_to_move()); TT.new_search(); H.clear(); @@ -192,8 +193,8 @@ void Search::think() { { int cf = Options["Contempt Factor"] * PawnValueMg / 100; // In centipawns cf = cf * MaterialTable::game_phase(pos) / PHASE_MIDGAME; // Scale down with phase - DrawValue[ Eval::RootColor] = VALUE_DRAW - Value(cf); - DrawValue[~Eval::RootColor] = VALUE_DRAW + Value(cf); + DrawValue[ RootColor] = VALUE_DRAW - Value(cf); + DrawValue[~RootColor] = VALUE_DRAW + Value(cf); } else DrawValue[WHITE] = DrawValue[BLACK] = VALUE_DRAW; @@ -1023,7 +1024,8 @@ split_point_start: // At split points actual search starts from here // If we are in a singular extension search then return a fail low score. // A split node has at least one move, the one tried before to be splitted. if (!moveCount) - return excludedMove ? alpha : inCheck ? mated_in(ss->ply) : VALUE_DRAW; + return excludedMove ? alpha + : inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()]; // If we have pruned all the moves without searching return a fail-low score if (bestValue == -VALUE_INFINITE)