]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Give a small penalty for bishop for each pawn on the same colored square
[stockfish] / src / pawns.cpp
index fca33f281a2bb69c6641d6f0c519b50a40c9dadf..3d99bfc68645a3e327554eef3fc2e067755a1297 100644 (file)
@@ -176,6 +176,12 @@ namespace {
             value += CandidateBonus[relative_rank(Us, s)];
     }
 
+    e->pawnsOnWhiteSquaresCount[Us]   = popcount<Max15>(ourPawns   & WhiteSquares);
+    e->pawnsOnWhiteSquaresCount[Them] = popcount<Max15>(theirPawns & WhiteSquares);
+
+    e->pawnsOnBlackSquaresCount[Us]   = popcount<Max15>(ourPawns   & BlackSquares);
+    e->pawnsOnBlackSquaresCount[Them] = popcount<Max15>(theirPawns & BlackSquares); 
+
     return value;
   }
 }
@@ -231,7 +237,7 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
   Rank rkUs, rkThem;
   File kf = file_of(ksq);
 
-  kf = (kf == FILE_A) ? kf++ : (kf == FILE_H) ? kf-- : kf;
+  kf = (kf == FILE_A) ? FILE_B : (kf == FILE_H) ? FILE_G : kf;
 
   for (int f = kf - 1; f <= kf + 1; f++)
   {