]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Save futilityMargin for both colors
[stockfish] / src / evaluate.cpp
index b50a023b557c3aad61691721c638c1df7b6ee68a..d225de26fff69994013aabd9762dc373abe730f6 100644 (file)
@@ -436,21 +436,6 @@ Value do_evaluate(const Position& pos, EvalInfo& ei, int threadID) {
 
 } // namespace
 
-/// quick_evaluate() does a very approximate evaluation of the current position.
-/// It currently considers only material and piece square table scores. Perhaps
-/// we should add scores from the pawn and material hash tables?
-
-Value quick_evaluate(const Position &pos) {
-
-  assert(pos.is_ok());
-
-  static const ScaleFactor sf[2] = {SCALE_FACTOR_NORMAL, SCALE_FACTOR_NORMAL};
-
-  Value v = scale_by_game_phase(pos.value(), MaterialInfoTable::game_phase(pos), sf);
-  return (pos.side_to_move() == WHITE ? v : -v);
-}
-
-
 /// init_eval() initializes various tables used by the evaluation function
 
 void init_eval(int threads) {
@@ -875,11 +860,8 @@ namespace {
       // capturing a single attacking piece can therefore result in a score
       // change far bigger than the value of the captured piece.
       Score v = apply_weight(make_score(SafetyTable[attackUnits], 0), WeightKingSafety[Us]);
-
       ei.value -= Sign[Us] * v;
-
-      if (Us == pos.side_to_move())
-          ei.futilityMargin += mg_value(v);
+      ei.futilityMargin[Us] += mg_value(v);
     }
   }