X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=401977bdf52980975576ece727f5fe824140bc4d;hp=4d878e2063419a590e3a18a3633c1b75444820fa;hb=15e21911110f9d459c4fef2bb17903d97345d0b9;hpb=ab580106fd995c23aaa7c297e9cbd210cfd33f11 diff --git a/src/pawns.cpp b/src/pawns.cpp index 4d878e20..401977bd 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -102,7 +102,7 @@ namespace { const Square* pl = pos.list(Us); const Bitboard* pawnAttacksBB = StepAttacksBB[make_piece(Us, PAWN)]; - Bitboard ourPawns = pos.pieces(Us, PAWN); + Bitboard ourPawns = pos.pieces(Us , PAWN); Bitboard theirPawns = pos.pieces(Them, PAWN); e->passedPawns[Us] = e->candidatePawns[Us] = 0; @@ -193,7 +193,7 @@ namespace { value += Connected[f][relative_rank(Us, s)]; if (lever) - value += Lever[relative_rank(Us, s)]; + value += Lever[relative_rank(Us, s)]; if (candidate) { @@ -204,13 +204,12 @@ namespace { } } + b = e->semiopenFiles[Us] ^ 0xFF; + e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0; + // In endgame it's better to have pawns on both wings. So give a bonus according // to file distance between left and right outermost pawns. - if (pos.count(Us) > 1) - { - b = e->semiopenFiles[Us] ^ 0xFF; - value += PawnsFileSpan * int(msb(b) - lsb(b)); - } + value += PawnsFileSpan * e->pawnSpan[Us]; return value; }