@@ -1821,7 +1821,7 @@ namespace {
18211821 if (bestValue >= beta)
18221822 {
18231823 // Store the score to avoid a future costly evaluation() call
1824- if (!isCheck && !tte && ei.futilityMargin == 0 )
1824+ if (!isCheck && !tte && ei.futilityMargin [pos. side_to_move ()] == 0 )
18251825 TT.store (pos.get_key (), value_to_tt (bestValue, ply), VALUE_TYPE_EV_LO, Depth (-127 *OnePly), MOVE_NONE);
18261826
18271827 return bestValue;
@@ -1840,7 +1840,7 @@ namespace {
18401840 MovePicker mp = MovePicker (pos, ttMove, deepChecks ? Depth (0 ) : depth, H);
18411841 CheckInfo ci (pos);
18421842 enoughMaterial = pos.non_pawn_material (pos.side_to_move ()) > RookValueMidgame;
1843- futilityBase = staticValue + FutilityMarginQS + ei.futilityMargin ;
1843+ futilityBase = staticValue + FutilityMarginQS + ei.futilityMargin [pos. side_to_move ()] ;
18441844
18451845 // Loop through the moves until no moves remain or a beta cutoff
18461846 // occurs.
@@ -1920,7 +1920,7 @@ namespace {
19201920 {
19211921 // If bestValue isn't changed it means it is still the static evaluation
19221922 // of the node, so keep this info to avoid a future evaluation() call.
1923- ValueType type = (bestValue == staticValue && !ei.futilityMargin ? VALUE_TYPE_EV_UP : VALUE_TYPE_UPPER);
1923+ ValueType type = (bestValue == staticValue && !ei.futilityMargin [pos. side_to_move ()] ? VALUE_TYPE_EV_UP : VALUE_TYPE_UPPER);
19241924 TT.store (pos.get_key (), value_to_tt (bestValue, ply), type, d, MOVE_NONE);
19251925 }
19261926 else if (bestValue >= beta)
0 commit comments