X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=fe02ca29efc07cf59327428819154bf0ae0728a0;hp=d3665ea16a11a4bebb546e59eac7fd9ec964d821;hb=6fb0a1bc4050dd9b15e9c163c46c60f25c48137d;hpb=8631b08d9704dac256462f6b5b885a4d8b0a9165;ds=sidebyside diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d3665ea1..fe02ca29 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -583,12 +583,12 @@ namespace { Square blockSq = s + pawn_push(Us); // Adjust bonus based on the king's proximity - ebonus += square_distance(pos.king_square(Them), blockSq) * 5 * rr - - square_distance(pos.king_square(Us ), blockSq) * 2 * rr; + ebonus += distance(pos.king_square(Them), blockSq) * 5 * rr + - distance(pos.king_square(Us ), blockSq) * 2 * rr; // If blockSq is not the queening square then consider also a second push if (relative_rank(Us, blockSq) != RANK_8) - ebonus -= square_distance(pos.king_square(Us), blockSq + pawn_push(Us)) * rr; + ebonus -= 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))