mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Sync with master
bench: 8285241
This commit is contained in:
commit
be50952533
2 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -67,7 +67,6 @@ struct Entry {
|
|||
Bitboard pawnAttacks[COLOR_NB];
|
||||
Square kingSquares[COLOR_NB];
|
||||
Score kingSafety[COLOR_NB];
|
||||
int minKingPawnDistance[COLOR_NB];
|
||||
int castlingRights[COLOR_NB];
|
||||
int semiopenFiles[COLOR_NB];
|
||||
int pawnSpan[COLOR_NB];
|
||||
|
|
Loading…
Add table
Reference in a new issue