]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Clarify the mapping of files to queenside
[stockfish] / src / pawns.cpp
index 1ae65bf181bcb74dac8755704776bf95a31a3a4c..d822ef4ef85e8387d7a206db3f85714646844ee2 100644 (file)
@@ -130,7 +130,7 @@ namespace {
         // Score this pawn
         if (support | phalanx)
         {
-            int v =  Connected[r] * (phalanx ? 3 : 2) / (opposed ? 2 : 1)
+            int v =  Connected[r] * (2 + bool(phalanx) - opposed)
                    + 17 * popcount(support);
 
             score += make_score(v, v * (r - 2) / 4);
@@ -198,7 +198,7 @@ Score Entry::evaluate_shelter(const Position& pos, Square ksq) {
       b = theirPawns & file_bb(f);
       int theirRank = b ? relative_rank(Us, frontmost_sq(Them, b)) : 0;
 
-      int d = std::min(f, ~f);
+      int d = map_to_queenside(f);
       bonus += make_score(ShelterStrength[d][ourRank], 0);
 
       if (ourRank && (ourRank == theirRank - 1))