Fix isolated and backward pawns scoring
authorMarco Costalba <mcostalba@gmail.com>
Sat, 17 Jul 2010 16:32:54 +0000 (17:32 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 17 Jul 2010 16:32:54 +0000 (17:32 +0100)
It is more clear and also more correct because we
consider enemy pawns only in fornt of us and not just
on our file.

Very small functional change, almost not measurable, but
keep the patch for documenting purposes.

Spotted by Marek Kwiatkowski.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/pawns.cpp

index 1cdeb461d51e2a2e74a56860f3d3e3c65998d70d..34c25959ab957e300a4857056f4ca5f23bc4efa2 100644 (file)
@@ -274,7 +274,7 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
       if (isolated)
       {
           value -= IsolatedPawnPenalty[f];
-          if (!(theirPawns & file_bb(f)))
+          if (!opposed)
               value -= IsolatedPawnPenalty[f] / 2;
       }
       if (doubled)
@@ -283,7 +283,7 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
       if (backward)
       {
           value -= BackwardPawnPenalty[f];
-          if (!(theirPawns & file_bb(f)))
+          if (!opposed)
               value -= BackwardPawnPenalty[f] / 2;
       }
       if (chain)