ss->ttMove = ttMove = RootNode ? RootMoves[PVIdx].pv[0] : ttHit ? tte->move() : MOVE_NONE;
ttValue = ttHit ? value_from_tt(tte->value(), ss->ply) : VALUE_NONE;
- // At non-PV nodes we check for a fail high/low. We don't probe at PV nodes
+ // At non-PV nodes we check for a fail high/low. We don't prune at PV nodes
if ( !PvNode
&& ttHit
&& tte->depth() >= depth
if (is_ok((ss-2)->currentMove) && (ss-1)->currentMove == (ss-1)->ttMove)
{
+ Value bonus2 = Value(((depth+1) / ONE_PLY) * ((depth+1) / ONE_PLY));
+
Square prevPrevSq = to_sq((ss-2)->currentMove);
Followupmoves.update(pos.piece_on(prevPrevSq), prevPrevSq, move);
+
+ Square prevMoveSq = to_sq((ss-1)->currentMove);
+ Piece prevMovePiece = pos.piece_on(prevMoveSq);
+
+ HistoryStats& cmh2 = CounterMovesHistory[pos.piece_on(prevPrevSq)][prevPrevSq];
+ cmh2.update(prevMovePiece, prevMoveSq, -bonus2);
}
}