X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=3838b125d714da79e755bc843eb674fe9fa1e52e;hp=6bd4513108ba92466f52d10e8e46c48916466a18;hb=a6d6a2c2fad093a47b575ee4cfb8d346ba037fb3;hpb=d01b66ae8f4090c8e12e72423ff9165e6bc3a2f8;ds=sidebyside diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 6bd45131..3838b125 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -740,11 +740,10 @@ namespace { int kingDistance = distance(pos.square(WHITE), pos.square(BLACK)) - distance(pos.square(WHITE), pos.square(BLACK)); - int pawns = pos.count(); bool bothFlanks = (pos.pieces(PAWN) & QueenSide) && (pos.pieces(PAWN) & KingSide); // Compute the initiative bonus for the attacking side - int initiative = 8 * (asymmetry + kingDistance - 17) + 12 * pawns + 16 * bothFlanks; + int initiative = 8 * (asymmetry + kingDistance - 17) + 12 * pos.count() + 16 * bothFlanks; // Now apply the bonus: note that we find the attacking side by extracting // the sign of the endgame value, and that we carefully cap the bonus so