mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 10:36:26 +08:00
Consolidate CastlingSide and CastlingRights
This is a non-functional simplification that removes CastlingSide and implements the functionality in CastlingRights (thanks to Jörg Oster for a comment on the first version of this patch). STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 53854 W: 12077 L: 12019 D: 29758 http://tests.stockfishchess.org/tests/view/5d517b940ebc5925cf107474 Closes https://github.com/official-stockfish/Stockfish/pull/2265 No functional change
This commit is contained in:
committed by
Stéphane Nicolet
parent
a016626825
commit
3984b8f8f0
@@ -238,10 +238,10 @@ Score Entry::do_king_safety(const Position& pos) {
|
||||
evaluate_shelter<Us>(pos, ksq, shelter);
|
||||
|
||||
// If we can castle use the bonus after the castling if it is bigger
|
||||
if (pos.can_castle(Us | KING_SIDE))
|
||||
if (pos.can_castle(Us & KING_SIDE))
|
||||
evaluate_shelter<Us>(pos, relative_square(Us, SQ_G1), shelter);
|
||||
|
||||
if (pos.can_castle(Us | QUEEN_SIDE))
|
||||
if (pos.can_castle(Us & QUEEN_SIDE))
|
||||
evaluate_shelter<Us>(pos, relative_square(Us, SQ_C1), shelter);
|
||||
|
||||
return shelter - make_score(0, 16 * minPawnDist);
|
||||
|
||||
Reference in New Issue
Block a user