- void update_stats(const Position& pos, Stack* ss, Move move,
- Move* quiets, int quietsCnt, int bonus) {
+ void update_capture_stats(const Position& pos, Move move,
+ Move* captures, int captureCnt, int bonus) {
+
+ CapturePieceToHistory& captureHistory = pos.this_thread()->captureHistory;
+ Piece moved_piece = pos.moved_piece(move);
+ PieceType captured = type_of(pos.piece_on(to_sq(move)));
+
+ if (pos.capture_or_promotion(move))
+ captureHistory[moved_piece][to_sq(move)][captured] << bonus;
+
+ // Decrease all the other played capture moves
+ for (int i = 0; i < captureCnt; ++i)
+ {
+ moved_piece = pos.moved_piece(captures[i]);
+ captured = type_of(pos.piece_on(to_sq(captures[i])));
+ captureHistory[moved_piece][to_sq(captures[i])][captured] << -bonus;
+ }
+ }
+
+
+ // update_quiet_stats() updates move sorting heuristics when a new quiet best move is found
+
+ void update_quiet_stats(const Position& pos, Stack* ss, Move move,
+ Move* quiets, int quietsCnt, int bonus) {