bool Position::legal(Move m, Bitboard pinned) const {
assert(is_ok(m));
- assert(pinned == pinned_pieces(pos.side_to_move()));
+ assert(pinned == pinned_pieces(sideToMove));
Color us = sideToMove;
Square from = from_sq(m);
// is moving along the ray towards or away from the king.
return !pinned
|| !(pinned & from)
- || squares_aligned(from, to_sq(m), king_square(us));
+ || aligned(from, to_sq(m), king_square(us));
}
{
// For pawn and king moves we need to verify also direction
if ( (pt != PAWN && pt != KING)
- || !squares_aligned(from, to, king_square(~sideToMove)))
+ || !aligned(from, to, king_square(~sideToMove)))
return true;
}