- // Don't prune the move if opponent King/Queen/Rook gets a discovered attack during or after the exchanges
- Bitboard leftEnemies = pos.pieces(~us, KING, QUEEN, ROOK);
- Bitboard attacks = 0;
- occupied |= to_sq(move);
- while (leftEnemies && !attacks)
- {
+ if (depth < 2 - capture)
+ continue;
+ // Don't prune the move if opponent Queen/Rook is under discovered attack after the exchanges
+ // Don't prune the move if opponent King is under discovered attack after or during the exchanges
+ Bitboard leftEnemies = (pos.pieces(~us, KING, QUEEN, ROOK)) & occupied;
+ Bitboard attacks = 0;
+ occupied |= to_sq(move);
+ while (leftEnemies && !attacks)
+ {