]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Restore old aspiration window to 16
[stockfish] / src / evaluate.cpp
index 57bbfe09d87f6d97a4a940a3be85930d0f9641fb..8c84ac299777e7ff7a33f91cb2f9e439de783686 100644 (file)
@@ -204,6 +204,8 @@ namespace {
   const int BishopCheck       = 2;
   const int KnightCheck       = 3;
 
+  const int UnsupportedPinnedPiece = 2;
+
   // KingDanger[Color][attackUnits] contains the actual king danger weighted
   // scores, indexed by color and by a calculated integer number.
   Score KingDanger[COLOR_NB][128];
@@ -693,6 +695,10 @@ Value do_evaluate(const Position& pos) {
         if (b)
             attackUnits += KnightCheck * popcount<Max15>(b);
 
+        // Penalty for pinned pieces not defended by a pawn
+        if (ei.pinnedPieces[Us] & ~ei.attackedBy[Us][PAWN])
+            attackUnits += UnsupportedPinnedPiece;
+
         // To index KingDanger[] attackUnits must be in [0, 99] range
         attackUnits = std::min(99, std::max(0, attackUnits));
 
@@ -961,8 +967,8 @@ Value do_evaluate(const Position& pos) {
     switch (idx) {
     case PST: case IMBALANCE: case PAWN: case TOTAL:
         ss << std::setw(20) << name << " |   ---   --- |   ---   --- | "
-           << std::setw(6)  << to_cp(mg_value(wScore)) << " "
-           << std::setw(6)  << to_cp(eg_value(wScore)) << " \n";
+           << std::setw(6)  << to_cp(mg_value(wScore - bScore)) << " "
+           << std::setw(6)  << to_cp(eg_value(wScore - bScore)) << " \n";
         break;
     default:
         ss << std::setw(20) << name << " | " << std::noshowpos