X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=1408687348fa8f485a14406cc52f22e793517ca8;hp=c5f1b22c270e2bd40bb7fb2537720a12fa5dcad4;hb=13c11f40480ec97316bd4da3a53787cc871037ea;hpb=856a5f3aaaf8b9d53599963decacd4476b55c034 diff --git a/src/pawns.cpp b/src/pawns.cpp index c5f1b22c..14086873 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -149,7 +149,7 @@ namespace { isolated = !neighbours; // Test for backward pawn. - // If the pawn is passed, isolated, connected or a lever it cannot be + // If the pawn is passed, isolated, lever or connected it cannot be // backward. If there are friendly pawns behind on adjacent files // it cannot be backward either. if ( (passed | isolated | lever | connected) @@ -294,14 +294,14 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) { kingSquares[Us] = ksq; castlingRights[Us] = pos.can_castle(Us); - minKingPawnDistance[Us] = 0; + int minKingPawnDistance = 0; Bitboard pawns = pos.pieces(Us, PAWN); if (pawns) - while (!(DistanceRingBB[ksq][minKingPawnDistance[Us]++] & pawns)) {} + while (!(DistanceRingBB[ksq][minKingPawnDistance++] & pawns)) {} if (relative_rank(Us, ksq) > RANK_4) - return make_score(0, -16 * minKingPawnDistance[Us]); + return make_score(0, -16 * minKingPawnDistance); Value bonus = shelter_storm(pos, ksq); @@ -312,7 +312,7 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) { if (pos.can_castle(MakeCastling::right)) bonus = std::max(bonus, shelter_storm(pos, relative_square(Us, SQ_C1))); - return make_score(bonus, -16 * minKingPawnDistance[Us]); + return make_score(bonus, -16 * minKingPawnDistance); } // Explicit template instantiation