mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 02:27:00 +08:00
Piece mobility: filter out squares protected by pawns
Do not consider squares protected by enemy pawns in mobility evaluation. This reduces the mobility value by about 15% Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -575,8 +575,11 @@ namespace {
|
||||
ei.kingAdjacentZoneAttacksCount[us] += count_1s_max_15(bb);
|
||||
}
|
||||
|
||||
// Remove squares protected by enemy pawns
|
||||
Bitboard bb = (b & ~ei.attackedBy[them][PAWN]);
|
||||
|
||||
// Mobility
|
||||
int mob = count_1s_max_15(b & ~p.pieces_of_color(us));
|
||||
int mob = count_1s_max_15(bb & ~p.pieces_of_color(us));
|
||||
ei.mgMobility += Sign[us] * mgBonus[mob];
|
||||
ei.egMobility += Sign[us] * egBonus[mob];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user