No functional change.
break;
case EVASIONS:
{
- if (pos.checkers() & (pos.pieces(CANNON, BANNER) | pos.pieces(HORSE, ELEPHANT) | pos.pieces(JANGGI_CANNON, JANGGI_ELEPHANT)))
+ if (pos.checkers() & pos.non_sliding_riders())
{
target = ~pos.pieces(Us);
break;
*moveList++ = make<SPECIAL>(ksq, ksq);
// Consider all evasion moves for special pieces
- if (sliders & (pos.pieces(CANNON, BANNER) | pos.pieces(HORSE, ELEPHANT) | pos.pieces(JANGGI_CANNON, JANGGI_ELEPHANT)))
+ if (sliders & pos.non_sliding_riders())
{
Bitboard target = pos.board_bb() & ~pos.pieces(us);
Bitboard b = ( (pos.attacks_from(us, KING, ksq) & pos.pieces())
// Evasions generator already takes care to avoid some kind of illegal moves
// and legal() relies on this. We therefore have to take care that the same
// kind of moves are filtered out here.
- if (checkers() && !(checkers() & (pieces(CANNON, BANNER) | pieces(HORSE, ELEPHANT) | pieces(JANGGI_CANNON, JANGGI_ELEPHANT))))
+ if (checkers() && !(checkers() & non_sliding_riders()))
{
if (type_of(pc) != KING)
{
Bitboard pieces(Color c, PieceType pt) const;
Bitboard pieces(Color c, PieceType pt1, PieceType pt2) const;
Bitboard major_pieces(Color c) const;
+ Bitboard non_sliding_riders() const;
Piece piece_on(Square s) const;
Piece unpromoted_piece_on(Square s) const;
Square ep_square() const;
return pieces(c) & (pieces(QUEEN) | pieces(AIWOK) | pieces(ARCHBISHOP) | pieces(CHANCELLOR) | pieces(AMAZON));
}
+inline Bitboard Position::non_sliding_riders() const {
+ return pieces(CANNON, BANNER) | pieces(HORSE, ELEPHANT) | pieces(JANGGI_CANNON, JANGGI_ELEPHANT);
+}
+
inline int Position::count(Color c, PieceType pt) const {
return pieceCount[make_piece(c, pt)];
}