]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Fix Contempt Factor implementation
[stockfish] / src / evaluate.cpp
index fdfacc10b910f71d0a7a802afd8f0d8d33efda46..69f0e4c27fa75e4caff8b23db06d911e23819de6 100644 (file)
@@ -268,7 +268,8 @@ namespace {
 namespace Eval {
 
   Color RootColor;
-  Value ValueDrawContempt;
+  Value ContemptFactor;
+  Value ValueDraw[2];
 
   /// evaluate() is the main evaluation function. It always computes two
   /// values, an endgame score and a middle game score, and interpolates
@@ -309,7 +310,10 @@ namespace Eval {
         KingDangerTable[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);
     }
 
-    ValueDrawContempt = VALUE_DRAW - Options["Contempt Factor"] * PawnValueMg / 100;
+    if (Options["UCI_AnalyseMode"])
+        ContemptFactor = VALUE_ZERO;
+    else
+        ContemptFactor = Options["Contempt Factor"] * PawnValueMg / 100;
   }