- // Enhance score accuracy with TT value if possible
- futilityValue = staticValue + FutilityValueMargin;
- staticValue = refine_eval(tte, staticValue, ply);
+ // Evaluate the position statically
+ if (isCheck)
+ ss[ply].eval = VALUE_NONE;
+ else
+ {
+ if (tte && (tte->type() & VALUE_TYPE_EVAL))
+ staticValue = value_from_tt(tte->value(), ply);
+ else
+ staticValue = evaluate(pos, ei, threadID);
+
+ ss[ply].eval = staticValue;
+ futilityValue = staticValue + FutilityValueMargin;
+ staticValue = refine_eval(tte, staticValue, ply); // Enhance accuracy with TT value if possible
+ }