From 6c27bf18808889ae4aef73d03c6d6a8f7a6107b5 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 14 May 2010 11:53:33 +0200 Subject: [PATCH] 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 --- src/evaluate.cpp | 2 +- src/position.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index e3eb0b33..32bd35f6 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -556,7 +556,7 @@ namespace { ei.value -= Sign[Us] * ThreatedByPawnPenalty[Piece]; // 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(pos, ei, s); // Special patterns: trapped bishops on a7/h7/a2/h2 diff --git a/src/position.h b/src/position.h index 8121bec1..6472d735 100644 --- a/src/position.h +++ b/src/position.h @@ -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 { - 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 { -- 2.39.2