mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Sync with master
bench: 8285241
This commit is contained in:
@@ -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<Us>(pos, ksq);
|
||||
|
||||
@@ -312,7 +312,7 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) {
|
||||
if (pos.can_castle(MakeCastling<Us, QUEEN_SIDE>::right))
|
||||
bonus = std::max(bonus, shelter_storm<Us>(pos, relative_square(Us, SQ_C1)));
|
||||
|
||||
return make_score(bonus, -16 * minKingPawnDistance[Us]);
|
||||
return make_score(bonus, -16 * minKingPawnDistance);
|
||||
}
|
||||
|
||||
// Explicit template instantiation
|
||||
|
||||
Reference in New Issue
Block a user