X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=70c91f8ae7a877d2ffdf6efbf6395120835c2ce9;hp=3f01d56457c2fd8c5e026e8d75bc5e5421e9a951;hb=15616ad19965444ea66896a0511f2a4d48745110;hpb=b0fd2b6b983cd85c1f018577ca260e68568e4672 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 3f01d564..70c91f8a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -468,7 +468,7 @@ Value do_evaluate(const Position& pos, Value& margin) { if (bonus && (ei.attackedBy[Us][PAWN] & s)) { if ( !pos.pieces(Them, KNIGHT) - && !(same_color_squares(s) & pos.pieces(Them, BISHOP))) + && !(squares_of_color(s) & pos.pieces(Them, BISHOP))) bonus += bonus + bonus / 2; else bonus += bonus / 2; @@ -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));