- // 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];
- }
+ // Don't allow pinned pieces to attack pieces except the king as long all
+ // pinners are on their original square.
+ if (!(st->pinnersForKing[stm] & ~occupied))
+ stmAttackers &= ~st->blockersForKing[stm];
+
+ if (!stmAttackers)
+ return swapList[0];