- // is_dangerous() checks whether a move belongs to some classes of known
- // 'dangerous' moves so that we avoid to prune it.
- FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) {
-
- // Castle move?
- if (type_of(m) == CASTLE)
- return true;
-
- // Passed pawn move?
- if ( type_of(pos.piece_moved(m)) == PAWN
- && pos.pawn_is_passed(pos.side_to_move(), to_sq(m)))
- return true;
-
- // Entering a pawn endgame?
- if ( captureOrPromotion
- && type_of(pos.piece_on(to_sq(m))) != PAWN
- && type_of(m) == NORMAL
- && ( pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)
- - PieceValue[Mg][pos.piece_on(to_sq(m))] == VALUE_ZERO))
- return true;
-
- return false;
- }
-