mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Rethink En Passant Evasion Capture
It now checks if it were a discovery attack instead of the attacking piece is the double-moved pawn.
As a side effect, certain illegal fens have different, and slightly more logical move generation.
There is no intend to maintain particular behavior for such non-reachable fens.
Passed STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 47912 W: 4327 L: 4285 D: 39300
Ptnml(0-2): 144, 3312, 17012, 3334, 154
https://tests.stockfishchess.org/tests/view/5ff890946019e097de3ef0a5
closes https://github.com/official-stockfish/Stockfish/pull/3292
closes / fixes https://github.com/official-stockfish/Stockfish/issues/3270
No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
0266e70297
commit
5f222f1d98
@@ -156,10 +156,8 @@ namespace {
|
|||||||
{
|
{
|
||||||
assert(rank_of(pos.ep_square()) == relative_rank(Us, RANK_6));
|
assert(rank_of(pos.ep_square()) == relative_rank(Us, RANK_6));
|
||||||
|
|
||||||
// An en passant capture can be an evasion only if the checking piece
|
// An en passant capture cannot resolve a discovered check.
|
||||||
// is the double pushed pawn and so is in the target. Otherwise this
|
if (Type == EVASIONS && (target & (pos.ep_square() + Up)))
|
||||||
// is a discovery check and we are forced to do otherwise.
|
|
||||||
if (Type == EVASIONS && !(target & (pos.ep_square() - Up)))
|
|
||||||
return moveList;
|
return moveList;
|
||||||
|
|
||||||
b1 = pawnsNotOn7 & pawn_attacks_bb(Them, pos.ep_square());
|
b1 = pawnsNotOn7 & pawn_attacks_bb(Them, pos.ep_square());
|
||||||
|
|||||||
Reference in New Issue
Block a user