X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=4ac4c086c00e18f29419c96df0696b3f2f23cfc0;hp=06546f99d038d7942162de2a2bf3d60eeeab3d9a;hb=ad937d0b2d2a9450686b9f3412c891a68ff19310;hpb=495a0fa699fb3f8ed36fe343fbd910479df4e2f1;ds=sidebyside diff --git a/src/search.cpp b/src/search.cpp index 06546f99..4ac4c086 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -42,6 +42,7 @@ namespace Search { LimitsType Limits; std::vector RootMoves; Position RootPos; + Color RootColor; Time::point SearchTime; StateStackPtr SetupStates; } @@ -181,11 +182,12 @@ void Search::think() { static PolyglotBook book; // Defined static to initialize the PRNG only once - TimeMgr.init(Limits, RootPos.game_ply(), RootPos.side_to_move()); + RootColor = RootPos.side_to_move(); + TimeMgr.init(Limits, RootPos.game_ply(), RootColor); int cf = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns - DrawValue[ RootPos.side_to_move()] = VALUE_DRAW - Value(cf); - DrawValue[~RootPos.side_to_move()] = VALUE_DRAW + Value(cf); + DrawValue[ RootColor] = VALUE_DRAW - Value(cf); + DrawValue[~RootColor] = VALUE_DRAW + Value(cf); if (RootMoves.empty()) { @@ -214,8 +216,8 @@ void Search::think() { log << "\nSearching: " << RootPos.fen() << "\ninfinite: " << Limits.infinite << " ponder: " << Limits.ponder - << " time: " << Limits.time[RootPos.side_to_move()] - << " increment: " << Limits.inc[RootPos.side_to_move()] + << " time: " << Limits.time[RootColor] + << " increment: " << Limits.inc[RootColor] << " moves to go: " << Limits.movestogo << "\n" << std::endl; }