Fix a very old bug in queen mobility
authorMarco Costalba <mcostalba@gmail.com>
Sat, 10 Jan 2009 15:11:33 +0000 (16:11 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 10 Jan 2009 15:11:33 +0000 (16:11 +0100)
For queen mobility could be bigger then 15, so
we need count_1s() not count_1s_max_15().

This bug was introduced by patch:
"Group common evaluate code" of 24/9/2008

So it's almost 4 months and two release old!

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

index c2e03d97e25564e5d1b8b80309fe5eec6b9262bc..04e4dded86474e507fd88974648e01888ea1d37b 100644 (file)
@@ -586,7 +586,9 @@ namespace {
     Bitboard bb = (b & ~ei.attackedBy[them][PAWN]);
 
     // Mobility
-    int mob = count_1s_max_15(bb & ~p.pieces_of_color(us));
+    int mob = (Piece != QUEEN ? count_1s_max_15(bb & ~p.pieces_of_color(us))
+                              : count_1s(bb & ~p.pieces_of_color(us)));
+
     ei.mgMobility += Sign[us] * MgBonus[Piece][mob];
     ei.egMobility += Sign[us] * EgBonus[Piece][mob];