]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Don't set Search::RootColor in Eval::trace
[stockfish] / src / evaluate.cpp
index 25ee79ead4df1ca94f1ddbe95d62a36b49496c84..70c91f8ae7a877d2ffdf6efbf6395120835c2ce9 100644 (file)
@@ -1083,7 +1083,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
 
     int ev = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
     int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128;
-    return Value((result + GrainSize / 2) & ~(GrainSize - 1));
+    return Value((result / GrainSize) * GrainSize); // Sign independent
   }
 
   // apply_weight() weights score v by score w trying to prevent overflow
@@ -1140,8 +1140,6 @@ Value do_evaluate(const Position& pos, Value& margin) {
 
   std::string Tracing::do_trace(const Position& pos) {
 
-    Search::RootColor = pos.side_to_move();
-
     stream.str("");
     stream << std::showpoint << std::showpos << std::fixed << std::setprecision(2);
     std::memset(scores, 0, 2 * (TOTAL + 1) * sizeof(Score));