{
PieceType move_pt = pt == KING ? king_type() : pt;
// Consider asymmetrical move of horse
- if (move_pt == HORSE || move_pt == BANNER)
+ if (AttackRiderTypes[move_pt] & ASYMMETRICAL_RIDERS)
{
Bitboard horses = PseudoAttacks[~c][move_pt][s] & pieces(c, pt);
while (horses)
if (type_of(m) != PROMOTION && type_of(m) != PIECE_PROMOTION && type_of(m) != PIECE_DEMOTION)
{
PieceType pt = type_of(moved_piece(m));
- if (pt == CANNON || pt == BANNER || pt == HORSE)
+ if (AttackRiderTypes[pt] & (HOPPING_RIDERS | ASYMMETRICAL_RIDERS))
{
if (attacks_bb(sideToMove, pt, to, (pieces() ^ from) | to) & square<KING>(~sideToMove))
return true;
RIDER_CANNON_V = 1 << 4,
RIDER_HORSE = 1 << 5,
RIDER_ELEPHANT = 1 << 6,
+ HOPPING_RIDERS = RIDER_CANNON_H | RIDER_CANNON_V,
+ ASYMMETRICAL_RIDERS = RIDER_HORSE,
};
extern Value PieceValue[PHASE_NB][PIECE_NB];