Introduce scale factor in pawn evaluation
[stockfish] / src / evaluate.cpp
index 9bb6c1c00516446bde294b38da18443c39da25d3..5f86227c2c5e9718e4ec76a967638167054ebff0 100644 (file)
@@ -430,6 +430,13 @@ Value do_evaluate(const Position& pos, EvalInfo& ei, int threadID) {
           factor[BLACK] = sf;
   }
 
+  // If we don't already have an unusual scale factor, use pawn
+  // evaluation ones.
+  if (factor[WHITE] == SCALE_FACTOR_NORMAL)
+      factor[WHITE] = ei.pi->scale_factor(WHITE);
+  if (factor[BLACK] == SCALE_FACTOR_NORMAL)
+      factor[BLACK] = ei.pi->scale_factor(BLACK);
+
   // Interpolate between the middle game and the endgame score
   Color stm = pos.side_to_move();