]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Simplify mobility danger
[stockfish] / src / evaluate.cpp
index 34ec48902cfe9986d5c786e11b92fcdc5efc8566..e6938e189f4312f3eaff82f68c2645f9c0701533 100644 (file)
@@ -480,15 +480,12 @@ namespace {
                      +   4 * tropism
                      - 873 * !pos.count<QUEEN>(Them)
                      -   6 * mg_value(score) / 8
+                     +       mg_value(mobility[Them] - mobility[Us])
                      -   30;
 
         // Transform the kingDanger units into a Score, and subtract it from the evaluation
         if (kingDanger > 0)
-        {
-            int mobilityDanger = mg_value(mobility[Them] - mobility[Us]);
-            kingDanger = std::max(0, kingDanger + mobilityDanger);
             score -= make_score(kingDanger * kingDanger / 4096, kingDanger / 16);
-        }
     }
 
     // Penalty when our king is on a pawnless flank