// If the moving piece is a king, check whether the destination
// square is attacked by the opponent.
if (type_of_piece_on(from) == KING)
- return !(square_is_attacked(move_to(m), opposite_color(us)));
+ return !attacks_to(move_to(m), opposite_color(us));
// A non-king move is legal if and only if it is not pinned or it
// is moving along the ray towards or away from the king.
Color us = side_to_move();
Color them = opposite_color(us);
Square ksq = king_square(them);
- if (square_is_attacked(ksq, us))
+ if (attacks_to(ksq, us))
return false;
}