]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Further smplify pawn endgames
[stockfish] / src / evaluate.cpp
index 246d0e7f80a5da06c8ea1c48512d6a6f053f5963..787004b4e7ac59b65f20b8764dae93358aaa5274 100644 (file)
@@ -508,7 +508,9 @@ Value do_evaluate(const Position& pos, Value& margin) {
                 ei.kingAdjacentZoneAttacksCount[Us] += popcount<Max15>(bb);
         }
 
-        int mob = popcount<Piece == QUEEN ? Full : Max15>(b & mobilityArea);
+        int mob = Piece != QUEEN ? popcount<Max15>(b & mobilityArea)
+                                 : popcount<Full >(b & mobilityArea);
+
         mobility[Us] += MobilityBonus[Piece][mob];
 
         // Decrease score if we are attacked by an enemy pawn. Remaining part
@@ -876,9 +878,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
                 ebonus -= ebonus / 4;
         }
 
-        // Increase the bonus if we have more non-pawn pieces
-        if (pos.count<ALL_PIECES>(  Us) - pos.count<PAWN>(  Us) >
-            pos.count<ALL_PIECES>(Them) - pos.count<PAWN>(Them))
+        if (pos.count<PAWN>(Us) < pos.count<PAWN>(Them))
             ebonus += ebonus / 4;
 
         score += make_score(mbonus, ebonus);