X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=ad63e21630126499e168dba7fef10a550909e8ec;hp=1505bf67facd53bcd028eac73d795b25d49ee8af;hb=45072612d4ddc1483581eb7799d270778e71d5e3;hpb=c794c8c8016dfdc8360c9d5ab74dffa9d93d9277 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 1505bf67..ad63e216 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -258,9 +258,9 @@ namespace { // Find our pawns that are blocked or on the first two ranks Bitboard b = pos.pieces(Us, PAWN) & (shift(pos.pieces()) | LowRanks); - // Squares occupied by those pawns, by our king, or controlled by enemy pawns + // Squares occupied by those pawns, by our king or queen, or controlled by enemy pawns // are excluded from the mobility area. - mobilityArea[Us] = ~(b | pos.square(Us) | pe->pawn_attacks(Them)); + mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them)); // Initialise attackedBy bitboards for kings and pawns attackedBy[Us][KING] = pos.attacks_from(pos.square(Us)); @@ -301,7 +301,6 @@ namespace { Bitboard b, bb; Square s; Score score = SCORE_ZERO; - int mob; attackedBy[Us][Pt] = 0; @@ -326,8 +325,7 @@ namespace { kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]); } - mob = (Pt == KNIGHT || Pt == BISHOP) ? popcount(b & mobilityArea[Us] & ~pos.pieces(Us, QUEEN)) - : popcount(b & mobilityArea[Us]); + int mob = popcount(b & mobilityArea[Us]); mobility[Us] += MobilityBonus[Pt - 2][mob];