- // the adjacent files and cannot safely advance. Phalanx and isolated
- // pawns will be excluded when the pawn is scored.
- backward = !(neighbours & forward_ranks_bb(Them, s))
- && (stoppers & (leverPush | (s + Up)));
-
- // Span of backward pawns and span behind opposing pawns are not included
- // in the pawnAttacksSpan bitboard.
- if (!backward || phalanx)
- {
- if (opposed)
- e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s) &
- ~pawn_attack_span(Us, frontmost_sq(Them, opposed));
- else
- e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s);
- }
+ // the adjacent files and cannot safely advance.
+ backward = !(neighbours & forward_ranks_bb(Them, s + Up))
+ && (stoppers & (leverPush | blocked));
+
+ // Compute additional span if pawn is not backward nor blocked
+ if (!backward && !blocked)
+ e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s);