]> git.sesse.net Git - stockfish/commitdiff
Change color argument of square_is_weak()
authorMarco Costalba <mcostalba@gmail.com>
Fri, 14 May 2010 09:53:33 +0000 (11:53 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 14 May 2010 10:59:25 +0000 (11:59 +0100)
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>
src/evaluate.cpp
src/position.h

index e3eb0b33522a2bde91bd0d793a22744d0abb53b1..32bd35f6be805fe9514a9e35a587606881bc6422 100644 (file)
@@ -556,7 +556,7 @@ namespace {
             ei.value -= Sign[Us] * ThreatedByPawnPenalty[Piece];
 
         // Bishop and knight outposts squares
             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<Piece, Us>(pos, ei, s);
 
         // Special patterns: trapped bishops on a7/h7/a2/h2
             evaluate_outposts<Piece, Us>(pos, ei, s);
 
         // Special patterns: trapped bishops on a7/h7/a2/h2
index 8121bec1c9c0642c2e17f2a96b2acbcc9fccc76c..6472d73551c4ac272dfa12ee79d14c9b6681871a 100644 (file)
@@ -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 {