X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=5b64ac6163091814e53150544b2add49c93e10b0;hp=9f0d50c053027e00dff7d34f97d213ef239e2597;hb=f84f04742a30166c2751de28245e11922da132fb;hpb=158014b39d69eaaf791d4913b98ffde5c4d7a874 diff --git a/src/pawns.cpp b/src/pawns.cpp index 9f0d50c0..5b64ac61 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2012 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2008-2013 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -176,6 +176,12 @@ namespace { value += CandidateBonus[relative_rank(Us, s)]; } + e->pawnsOnSquares[Us][BLACK] = popcount(ourPawns & BlackSquares); + e->pawnsOnSquares[Us][WHITE] = pos.piece_count(Us, PAWN) - e->pawnsOnSquares[Us][BLACK]; + + e->pawnsOnSquares[Them][BLACK] = popcount(theirPawns & BlackSquares); + e->pawnsOnSquares[Them][WHITE] = pos.piece_count(Them, PAWN) - e->pawnsOnSquares[Them][BLACK]; + 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++) {