- // Find all attackers to the destination square, with the moving piece
- // removed, but possibly an X-ray attacker added behind it.
- attackers = attackers_to(to, occupied) & occupied;
-
- // If the opponent has no attackers we are finished
- stm = ~stm;
- stmAttackers = attackers & pieces(stm);
- if (!stmAttackers)
- return swapList[0];
-
- // Don't allow pinned pieces to attack as long all pinners (this includes also
- // potential ones) are on their original square. When a pinner moves to the
- // exchange-square or get captured on it, we fall back to standard SEE behaviour.
- else if ( (stmAttackers & st->blockersForKing[stm])
- && ((st->pinnersForKing[stm] & (occupied ^ (occupied & to))) == st->pinnersForKing[stm]))
- {
- // Pinned pieces can't attack so remove them from attackers
- stmAttackers ^= (stmAttackers & st->blockersForKing[stm]);
- if (!stmAttackers)
- return swapList[0];
- }
+ // Find all attackers to the destination square, with the moving piece removed,
+ // but possibly an X-ray attacker added behind it.
+ Bitboard attackers = attackers_to(to, occupied) & occupied;