]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Fix doubled pawns asymmetry
[stockfish] / src / pawns.cpp
index 523ed15725001933556a20b195573ddcd5143e4e..fe989e9b8f24a502f7febb083f4b6733beae5d8b 100644 (file)
@@ -57,9 +57,6 @@ namespace {
     S( 0, 0), S( 0, 0), S(0, 0), S(0, 0),
     S(20,20), S(40,40), S(0, 0), S(0, 0) };
 
-  // Bonus for file distance of the two outermost pawns
-  const Score PawnsFileSpan = S(0, 8);
-
   // Unsupported pawn penalty
   const Score UnsupportedPawnPenalty = S(20, 10);
 
@@ -168,7 +165,7 @@ namespace {
             value -= UnsupportedPawnPenalty;
 
         if (doubled)
-            value -= Doubled[f] / rank_distance(s, lsb(doubled));
+            value -= Doubled[f] / distance<Rank>(s, frontmost_sq(Us, doubled));
 
         if (backward)
             value -= Backward[opposed][f];
@@ -183,10 +180,6 @@ namespace {
     b = e->semiopenFiles[Us] ^ 0xFF;
     e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0;
 
-    // In endgame it's better to have pawns on both wings. So give a bonus according
-    // to file distance between left and right outermost pawns.
-    value += PawnsFileSpan * e->pawnSpan[Us];
-
     return value;
   }