mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 09:47:46 +00:00
Introduce distance() and unify some API
Original work by Lucas. No functional change.
This commit is contained in:
+3
-3
@@ -583,12 +583,12 @@ namespace {
|
||||
Square blockSq = s + pawn_push(Us);
|
||||
|
||||
// Adjust bonus based on the king's proximity
|
||||
ebonus += square_distance(pos.king_square(Them), blockSq) * 5 * rr
|
||||
- square_distance(pos.king_square(Us ), blockSq) * 2 * rr;
|
||||
ebonus += distance(pos.king_square(Them), blockSq) * 5 * rr
|
||||
- distance(pos.king_square(Us ), blockSq) * 2 * rr;
|
||||
|
||||
// If blockSq is not the queening square then consider also a second push
|
||||
if (relative_rank(Us, blockSq) != RANK_8)
|
||||
ebonus -= square_distance(pos.king_square(Us), blockSq + pawn_push(Us)) * rr;
|
||||
ebonus -= distance(pos.king_square(Us), blockSq + pawn_push(Us)) * rr;
|
||||
|
||||
// If the pawn is free to advance, then increase the bonus
|
||||
if (pos.empty(blockSq))
|
||||
|
||||
Reference in New Issue
Block a user