template<CastlingSide Side, bool OnlyChecks>
MoveStack* generate_castle(const Position& pos, MoveStack* mlist, Color us) {
template<CastlingSide Side, bool OnlyChecks>
MoveStack* generate_castle(const Position& pos, MoveStack* mlist, Color us) {
- CastleRight cr = CastleRight((Side == KING_SIDE ? WHITE_OO : WHITE_OOO) << us);
-
- if (pos.castle_impeded(us, Side) || !pos.can_castle(cr))
+ if (pos.castle_impeded(us, Side) || !pos.can_castle(make_castle_right(us, Side)))
return mlist;
// After castling, the rook and king final positions are the same in Chess960
// as they would be in standard chess.
Square kfrom = pos.king_square(us);
return mlist;
// After castling, the rook and king final positions are the same in Chess960
// as they would be in standard chess.
Square kfrom = pos.king_square(us);