X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=0bd99f9b0e6d9058f9f9e49b6efd21cced6416a6;hp=d2a53ef9679a1d69ee1655530b9af05cd39b382b;hb=f99cb3dc27719021e126690b7fd5aa5f43663ed8;hpb=dd4e5db2be2eb5631d739af634cb33bea2f3fddd diff --git a/src/pawns.cpp b/src/pawns.cpp index d2a53ef9..0bd99f9b 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -259,7 +259,7 @@ template Score Entry::update_safety(const Position& pos, Square ksq) { kingSquares[Us] = ksq; - castleRights[Us] = pos.can_castle(Us); + castlingFlags[Us] = pos.can_castle(Us); minKPdistance[Us] = 0; Bitboard pawns = pos.pieces(Us, PAWN); @@ -271,11 +271,11 @@ Score Entry::update_safety(const Position& pos, Square ksq) { Value bonus = shelter_storm(pos, ksq); - // If we can castle use the bonus after the castle if it is bigger - if (pos.can_castle(make_castle_right(Us, KING_SIDE))) + // If we can castle use the bonus after the castling if it is bigger + if (pos.can_castle(make_castling_flag(Us, KING_SIDE))) bonus = std::max(bonus, shelter_storm(pos, relative_square(Us, SQ_G1))); - if (pos.can_castle(make_castle_right(Us, QUEEN_SIDE))) + if (pos.can_castle(make_castling_flag(Us, QUEEN_SIDE))) bonus = std::max(bonus, shelter_storm(pos, relative_square(Us, SQ_C1))); return kingSafety[Us] = make_score(bonus, -16 * minKPdistance[Us]);