X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.h;h=e1583fc04928f14a34895188133fcf0e3e3d6824;hp=0376ce617f098e7c151dd45cf6816640936f11d8;hb=55df3fa2d7631ed67e46f9433aa7f3a71c18e5e7;hpb=32c504076f5a1d5c84f88c2d30a11c25ea2e5a6e diff --git a/src/pawns.h b/src/pawns.h index 0376ce61..e1583fc0 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -56,12 +56,14 @@ private: Value shelter_storm(const Position& pos, Square ksq); Key key; - Bitboard passedPawns[2]; - Bitboard pawnAttacks[2]; - Square kingSquares[2]; + Bitboard passedPawns[COLOR_NB]; + Bitboard pawnAttacks[COLOR_NB]; + Square kingSquares[COLOR_NB]; + int minKPdistance[COLOR_NB]; + int castleRights[COLOR_NB]; Score value; - int halfOpenFiles[2]; - Score kingSafety[2]; + int halfOpenFiles[COLOR_NB]; + Score kingSafety[COLOR_NB]; }; @@ -106,7 +108,8 @@ inline int PawnEntry::has_open_file_to_right(Color c, File f) const { template inline Score PawnEntry::king_safety(const Position& pos, Square ksq) { - return kingSquares[Us] == ksq ? kingSafety[Us] : update_safety(pos, ksq); + return kingSquares[Us] == ksq && castleRights[Us] == pos.can_castle(Us) + ? kingSafety[Us] : update_safety(pos, ksq); } #endif // !defined(PAWNS_H_INCLUDED)