]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Decrease reduction for moves that escape a capture
[stockfish] / src / search.cpp
index 99b89459b708d097ec3b7dbc605d17d3a05b4639..85d702c4d4c410e0eb4e5eb045977c6d891e5114 100644 (file)
@@ -868,6 +868,12 @@ moves_loop: // When in check and at SpNode search starts from here
           if (move == countermoves[0] || move == countermoves[1])
               ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
 
+          // Decrease reduction for moves that escape a capture
+          if (   ss->reduction
+              && type_of(pos.piece_on(to_sq(move))) != PAWN
+              && pos.see_sign(make_move(to_sq(move), from_sq(move))) < 0)
+              ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
+
           Depth d = std::max(newDepth - ss->reduction, ONE_PLY);
           if (SpNode)
               alpha = splitPoint->alpha;