X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=5c66202aa662416d9b4a4070e0e04214f16e69ed;hp=e1a000c6323d081a2458285083c2c38a4b0910b8;hb=93e3b06fe2d441d7011068712fddbc8bf46ce4ec;hpb=86c20416c85ac93ab982dda404fc268a92636fa6 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index e1a000c6..5c66202a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -583,8 +583,8 @@ namespace { assert(pos.pawn_passed(Us, s)); - Rank r = relative_rank(Us, s) - RANK_2; - Rank rr = r * (r - 1); + int r = relative_rank(Us, s) - RANK_2; + int rr = r * (r - 1); // Base bonus based on rank Value mbonus = Value(17 * rr), ebonus = Value(7 * (rr + r + 1)); @@ -599,7 +599,7 @@ namespace { // If blockSq is not the queening square then consider also a second push if (relative_rank(Us, blockSq) != RANK_8) - ebonus -= rr * square_distance(pos.king_square(Us), blockSq + pawn_push(Us)); + ebonus -= square_distance(pos.king_square(Us), blockSq + pawn_push(Us)) * rr; // If the pawn is free to advance, then increase the bonus if (pos.empty(blockSq)) @@ -920,7 +920,7 @@ namespace Eval { for (int t = 0, i = 1; i < 100; ++i) { - t = std::min(Peak, std::min(0.4 * i * i, t + MaxSlope)); + t = int(std::min(Peak, std::min(0.4 * i * i, t + MaxSlope))); KingDanger[1][i] = apply_weight(make_score(t, 0), Weights[KingDangerUs]); KingDanger[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);