Browse files

Fix a very old bug in queen mobility

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>
  • Loading branch information...
1 parent ec29272 commit 4b53bb02f69bd838b271b7919d1070580d6f73a7 @mcostalba committed Jan 10, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/evaluate.cpp
View
4 src/evaluate.cpp
@@ -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];

0 comments on commit 4b53bb0

Please sign in to comment.