X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=3ddf70308c51f70577743257ab7814cbb0240937;hp=1825b6e286be564edd9f1be685098529d144e949;hb=6f3796adaf44c48cf1353181d386a61a57859b67;hpb=7264540107b7f20d16628ac8615070fe3334f5f5 diff --git a/src/pawns.cpp b/src/pawns.cpp index 1825b6e2..3ddf7030 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -69,7 +69,7 @@ namespace { Score evaluate(const Position& pos, Pawns::Entry* e) { constexpr Color Them = (Us == WHITE ? BLACK : WHITE); - constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH); + constexpr Direction Up = pawn_push(Us); Bitboard neighbours, stoppers, support, phalanx, opposed; Bitboard lever, leverPush, blocked; @@ -108,7 +108,7 @@ namespace { // A pawn is backward when it is behind all pawns of the same color on // the adjacent files and cannot safely advance. backward = !(neighbours & forward_ranks_bb(Them, s + Up)) - && (stoppers & (leverPush | blocked)); + && (leverPush | blocked); // Compute additional span if pawn is not backward nor blocked if (!backward && !blocked)