}
// Do not search moves with negative SEE values
- if (!ss->inCheck && !pos.see_ge(move))
+ if ( !ss->inCheck
+ && !(givesCheck && pos.is_discovery_check_on_king(~pos.side_to_move(), move))
+ && !pos.see_ge(move))
continue;
// Speculative prefetch as early as possible