mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Change color argument of square_is_weak()
Pass the color for which the square is to be considered weak, not the opposite. It is more natural and intuitive in this way. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
da1165ae5d
commit
6c27bf1880
2 changed files with 2 additions and 2 deletions
|
@ -556,7 +556,7 @@ namespace {
|
||||||
ei.value -= Sign[Us] * ThreatedByPawnPenalty[Piece];
|
ei.value -= Sign[Us] * ThreatedByPawnPenalty[Piece];
|
||||||
|
|
||||||
// Bishop and knight outposts squares
|
// Bishop and knight outposts squares
|
||||||
if ((Piece == BISHOP || Piece == KNIGHT) && pos.square_is_weak(s, Them))
|
if ((Piece == BISHOP || Piece == KNIGHT) && pos.square_is_weak(s, Us))
|
||||||
evaluate_outposts<Piece, Us>(pos, ei, s);
|
evaluate_outposts<Piece, Us>(pos, ei, s);
|
||||||
|
|
||||||
// Special patterns: trapped bishops on a7/h7/a2/h2
|
// Special patterns: trapped bishops on a7/h7/a2/h2
|
||||||
|
|
|
@ -483,7 +483,7 @@ inline bool Position::pawn_is_passed(Color c, Square s) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool Position::square_is_weak(Square s, Color c) const {
|
inline bool Position::square_is_weak(Square s, Color c) const {
|
||||||
return !(pieces(PAWN, c) & outpost_mask(opposite_color(c), s));
|
return !(pieces(PAWN, opposite_color(c)) & outpost_mask(c, s));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Key Position::get_key() const {
|
inline Key Position::get_key() const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue