diff --git a/src/movepick.cpp b/src/movepick.cpp index 6d00dd94..f3d6fef8 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -314,7 +314,8 @@ 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() { - assert(stage == GOOD_QUIET || stage == BAD_QUIET || stage == EVASION); + // SEE negative captures shouldn't be returned in GOOD_CAPTURE stage + assert(stage > GOOD_CAPTURE && stage != EVASION_INIT); for (ExtMove* m = moves; m < endMoves; ++m) { diff --git a/src/search.cpp b/src/search.cpp index 775aacef..ee876f85 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1073,9 +1073,7 @@ moves_loop: // When in check, search starts here if (!pos.see_ge(move, -158 * depth - seeHist)) { bool mayStalemateTrap = - depth > 2 && givesCheck && alpha < 0 - && !capture // we consider that captures will likely destroy the stalemate configuration - && pos.non_pawn_material(us) == PieceValue[movedPiece] + 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())