diff --git a/src/movepick.cpp b/src/movepick.cpp index 0d2a72306..fa447e189 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -316,23 +316,4 @@ top: void MovePicker::skip_quiet_moves() { skipQuiets = true; } -// this function must be called after all quiet moves and captures have been generated -bool MovePicker::can_move_king_or_pawn() const { - - assert((GOOD_QUIET <= stage && stage <= BAD_QUIET) || stage == EVASION); - - // Until good capture state no quiet moves are generated for comparison so simply assume king or pawns can move. - // Do the same for other states that don't have a valid available move list. - if ((GOOD_QUIET > stage || stage > BAD_QUIET) && stage != EVASION) - return true; - - for (const ExtMove* m = moves; m < endGenerated; ++m) - { - PieceType movedPieceType = type_of(pos.moved_piece(*m)); - if ((movedPieceType == PAWN || movedPieceType == KING) && pos.legal(*m)) - return true; - } - return false; -} - } // namespace Stockfish diff --git a/src/movepick.h b/src/movepick.h index 6a3305c6c..922a9069b 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -50,7 +50,6 @@ class MovePicker { MovePicker(const Position&, Move, int, const CapturePieceToHistory*); Move next_move(); void skip_quiet_moves(); - bool can_move_king_or_pawn() const; private: template diff --git a/src/search.cpp b/src/search.cpp index aafc33789..1396a817d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1056,8 +1056,7 @@ moves_loop: // When in check, search starts here depth > 2 && alpha < 0 && pos.non_pawn_material(us) == PieceValue[movedPiece] && PieceValue[movedPiece] >= RookValue // it can't be stalemate if we moved a piece adjacent to the king - && !(attacks_bb(pos.square(us)) & move.from_sq()) - && !mp.can_move_king_or_pawn(); + && !(attacks_bb(pos.square(us)) & move.from_sq()); // avoid pruning sacrifices of our last piece for stalemate if (!mayStalemateTrap)