// Find our pawns that are blocked or on the first two ranks
Bitboard b = pos.pieces(Us, PAWN) & (shift<Down>(pos.pieces()) | LowRanks);
- // Squares occupied by those pawns, by our king, or controlled by enemy pawns
+ // Squares occupied by those pawns, by our king or queen, or controlled by enemy pawns
// are excluded from the mobility area.
- mobilityArea[Us] = ~(b | pos.square<KING>(Us) | pe->pawn_attacks(Them));
+ mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them));
// Initialise attackedBy bitboards for kings and pawns
attackedBy[Us][KING] = pos.attacks_from<KING>(pos.square<KING>(Us));
Bitboard b, bb;
Square s;
Score score = SCORE_ZERO;
- int mob;
attackedBy[Us][Pt] = 0;
kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]);
}
- mob = (Pt == KNIGHT || Pt == BISHOP) ? popcount(b & mobilityArea[Us] & ~pos.pieces(Us, QUEEN))
- : popcount(b & mobilityArea[Us]);
+ int mob = popcount(b & mobilityArea[Us]);
mobility[Us] += MobilityBonus[Pt - 2][mob];