- return excludedMove ? alpha
- : inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()];
-
- // If we have pruned all the moves without searching return a fail-low score
- if (bestValue == -VALUE_INFINITE)
- bestValue = alpha;
-
- TT.store(posKey, value_to_tt(bestValue, ss->ply),
- bestValue >= beta ? BOUND_LOWER :
- PvNode && bestMove ? BOUND_EXACT : BOUND_UPPER,
- depth, bestMove, ss->staticEval);
-
- // Quiet best move: update killers, history and countermoves
- if ( bestValue >= beta
- && !pos.capture_or_promotion(bestMove)
- && !inCheck)
- {
- if (ss->killers[0] != bestMove)
- {
- ss->killers[1] = ss->killers[0];
- ss->killers[0] = bestMove;
- }