mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Exclude blockers for king from mobility area
This patch excludes blockers for king from mobility area. It was tried a couple of times by now but now it passed. Performance is not enormously good but this patch makes a lot of sence - blockers for king can't really move until king moves (in most cases) so logic behind it is the same as behind excluding king square from mobility area. STC http://tests.stockfishchess.org/tests/view/5dec388651219d7befdc76be LLR: 2.95 (-2.94,2.94) [-1.50,4.50] Total: 6155 W: 1428 L: 1300 D: 3427 LTC http://tests.stockfishchess.org/tests/view/5dec4a3151219d7befdc76d3 LLR: 2.95 (-2.94,2.94) [0.00,3.50] Total: 120800 W: 19636 L: 19134 D: 82030 Bench: 5173081
This commit is contained in:
committed by
Stéphane Nicolet
parent
d00b2ec6bd
commit
764b9adda6
@@ -225,9 +225,9 @@ namespace {
|
||||
// Find our pawns that are blocked or on the first two ranks
|
||||
Bitboard b = pos.pieces(Us, PAWN) & (shift<Down>(pos.pieces()) | LowRanks);
|
||||
|
||||
// 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.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them));
|
||||
// Squares occupied by those pawns, by our king or queen, by blockers to attacks on our king
|
||||
// or controlled by enemy pawns are excluded from the mobility area.
|
||||
mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pos.blockers_for_king(Us) | pe->pawn_attacks(Them));
|
||||
|
||||
// Initialize attackedBy[] for king and pawns
|
||||
attackedBy[Us][KING] = pos.attacks_from<KING>(ksq);
|
||||
|
||||
Reference in New Issue
Block a user