+ // Quiet best move: update killers, history and countermoves
+ if (!pos.capture_or_promotion(bestMove))
+ {
+ Value bonus = Value(d * d + 2 * d - 2);
+ update_stats(pos, ss, bestMove, quietsSearched, quietCount, bonus);
+ }
+
+ // Extra penalty for a quiet TT move in previous ply when it gets refuted
+ if ((ss-1)->moveCount == 1 && !pos.captured_piece_type())
+ {
+ Value penalty = Value(d * d + 4 * d + 1);
+ update_opponent_stats(pos, ss, -penalty);
+ }
+ }