]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Remove the Queen from the mobility area of minor pieces
[stockfish] / src / evaluate.cpp
index e39bcb4a8e99721820fa637151ace370d009f5d9..41c66812717e587dffeafbca3f8935cef8204861 100644 (file)
@@ -300,6 +300,7 @@ namespace {
     Bitboard b, bb;
     Square s;
     Score score = SCORE_ZERO;
+    int mob;
 
     attackedBy[Us][Pt] = 0;
 
@@ -324,7 +325,8 @@ namespace {
             kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]);
         }
 
-        int mob = popcount(b & mobilityArea[Us]);
+        mob = (Pt == KNIGHT || Pt == BISHOP) ? popcount(b & mobilityArea[Us] & ~pos.pieces(Us, QUEEN))
+                                             : popcount(b & mobilityArea[Us]);
 
         mobility[Us] += MobilityBonus[Pt - 2][mob];