diff --git a/src/search.cpp b/src/search.cpp index e07c719e..7317b7e4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -125,7 +125,8 @@ void update_all_stats(const Position& pos, ValueList& quietsSearched, ValueList& capturesSearched, Depth depth, - bool isTTMove); + bool isTTMove, + int moveCount); } // namespace @@ -1372,7 +1373,7 @@ moves_loop: // When in check, search starts here // we update the stats of searched moves. else if (bestMove) update_all_stats(pos, ss, *this, bestMove, prevSq, quietsSearched, capturesSearched, depth, - bestMove == ttData.move); + bestMove == ttData.move, moveCount); // Bonus for prior countermove that caused the fail low else if (!priorCapture && prevSq != SQ_NONE) @@ -1792,14 +1793,15 @@ void update_all_stats(const Position& pos, ValueList& quietsSearched, ValueList& capturesSearched, Depth depth, - bool isTTMove) { + bool isTTMove, + int moveCount) { CapturePieceToHistory& captureHistory = workerThread.captureHistory; Piece moved_piece = pos.moved_piece(bestMove); PieceType captured; int bonus = stat_bonus(depth) + 300 * isTTMove; - int malus = stat_malus(depth); + int malus = stat_malus(depth) - 34 * (moveCount - 1); if (!pos.capture_stage(bestMove)) {