X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=72496fcc26ad5cf7b3844a48a6daf20388ae2c87;hp=74b3fd5e5d9c473f32ead6551ba5163931c52562;hb=e3af492142c8aff71f50dbec025722d69b84f85e;hpb=16c603ce9baa464c2f59cbd001987ec3a7cbc01f diff --git a/src/pawns.cpp b/src/pawns.cpp index 74b3fd5e..72496fcc 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -124,7 +124,7 @@ namespace { opposed = theirPawns & forward_bb(Us, s); stoppers = theirPawns & passed_pawn_mask(Us, s); lever = theirPawns & pawnAttacksBB[s]; - doubled = ourPawns & forward_bb(Us, s); + doubled = ourPawns & (s + Up); neighbours = ourPawns & adjacent_files_bb(f); phalanx = neighbours & rank_bb(s); supported = neighbours & rank_bb(s - Up); @@ -148,9 +148,8 @@ namespace { } // Passed pawns will be properly scored in evaluation because we need - // full attack info to evaluate them. Only the frontmost passed - // pawn on each file is considered a true passed pawn. - if (!(stoppers | doubled)) + // full attack info to evaluate them. + if (!stoppers && !(ourPawns & forward_bb(Us, s))) e->passedPawns[Us] |= s; // Score this pawn @@ -167,15 +166,12 @@ namespace { score += Connected[opposed][!!phalanx][more_than_one(supported)][relative_rank(Us, s)]; if (doubled) - score -= Doubled / distance(s, frontmost_sq(Us, doubled)); + score -= Doubled; if (lever) score += Lever[relative_rank(Us, s)]; } - b = e->semiopenFiles[Us] ^ 0xFF; - e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0; - return score; }