]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Tidy up in movepick.cpp
[stockfish] / src / search.cpp
index 7eab970a866ea27f30f3a500240affc98fac1b8b..9689668956e8ae77f147ef1f9203c9a58ffa7e57 100644 (file)
@@ -749,7 +749,7 @@ namespace {
         assert((ss-1)->currentMove != MOVE_NONE);
         assert((ss-1)->currentMove != MOVE_NULL);
 
-        MovePicker mp(pos, ttMove, History, CounterMovesHistory, pos.captured_piece_type());
+        MovePicker mp(pos, ttMove, History, CounterMovesHistory, PieceValue[MG][pos.captured_piece_type()]);
         CheckInfo ci(pos);
 
         while ((move = mp.next_move<false>()) != MOVE_NONE)
@@ -958,10 +958,9 @@ moves_loop: // When in check and at SpNode search starts from here
                                         [pos.piece_on(to_sq(move))][to_sq(move)] <= VALUE_ZERO))
               ss->reduction += ONE_PLY;
 
-          if (    move == countermove
-              || (   History[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO
-                  && CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq]
-                                        [pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO))
+          if (   History[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO
+              && CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq]
+                                    [pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO)
               ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
 
           // Decrease reduction for moves that escape a capture