- // Case 5: Discovered check, checking piece is the piece moved in m1
- ksq = pos.king_square(pos.side_to_move());
- if ( piece_is_slider(p1)
- && (between_bb(t1, ksq) & f2)
- && (pos.attacks_from(p1, t1, pos.pieces() ^ f2) & ksq))
+ // Threat gives a discovered check through the move's checking piece
+ if (t1_att & pos.king_square(pos.side_to_move()))
+ {
+ assert(between_bb(t1, pos.king_square(pos.side_to_move())) & f2);