X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=ea0dffc72ba34c738537cedd18f6e3797540407c;hp=36b10f32f6e1606a91f69bda1964bda11a51b4cb;hb=d2274e609c28e46a24deee55b05684197d369976;hpb=542a2b39ed811a3795cdce2416896ffaf2a485cf diff --git a/src/pawns.cpp b/src/pawns.cpp index 36b10f32..ea0dffc7 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -58,10 +58,6 @@ namespace { { V(-10), V(-14), V( 90), V(15), V( 2), V( -7), V(-16) } }; - // Danger of blocked enemy pawns storming our king, by rank - constexpr Value BlockedStorm[RANK_NB] = - { V(0), V(0), V(66), V(6), V(5), V(1), V(15) }; - #undef S #undef V @@ -225,7 +221,7 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) { int d = std::min(f, ~f); safety += ShelterStrength[d][ourRank]; - safety -= (ourRank && (ourRank == theirRank - 1)) ? BlockedStorm[theirRank] + safety -= (ourRank && (ourRank == theirRank - 1)) ? 66 * (theirRank == RANK_3) : UnblockedStorm[d][theirRank]; } @@ -237,8 +233,9 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) { /// when king square changes, which is about 20% of total king_safety() calls. template -Score Entry::do_king_safety(const Position& pos, Square ksq) { +Score Entry::do_king_safety(const Position& pos) { + Square ksq = pos.square(Us); kingSquares[Us] = ksq; castlingRights[Us] = pos.can_castle(Us); int minKingPawnDistance = 0; @@ -260,7 +257,7 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) { } // Explicit template instantiation -template Score Entry::do_king_safety(const Position& pos, Square ksq); -template Score Entry::do_king_safety(const Position& pos, Square ksq); +template Score Entry::do_king_safety(const Position& pos); +template Score Entry::do_king_safety(const Position& pos); } // namespace Pawns