mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Merge pull request #3496 from Sopel97/fix_discrep
Fix discrepancy for ep square between set and move in the binpack lib.
This commit is contained in:
@@ -6078,18 +6078,14 @@ namespace chess
|
||||
// for double pushes move index differs by 16 or -16;
|
||||
if((movedPiece == PieceType::Pawn) & ((ordinal(move.to) ^ ordinal(move.from)) == 16))
|
||||
{
|
||||
const Square potentialEpSquare = fromOrdinal<Square>((ordinal(move.to) + ordinal(move.from)) >> 1);
|
||||
// Even though the move has not yet been made we can safely call
|
||||
// this function and get the right result because the position of the
|
||||
// pawn to be captured is not really relevant.
|
||||
if (isEpPossible(potentialEpSquare, !m_sideToMove))
|
||||
{
|
||||
m_epSquare = potentialEpSquare;
|
||||
}
|
||||
m_epSquare = fromOrdinal<Square>((ordinal(move.to) + ordinal(move.from)) >> 1);
|
||||
}
|
||||
|
||||
const Piece captured = BaseType::doMove(move);
|
||||
m_sideToMove = !m_sideToMove;
|
||||
|
||||
nullifyEpSquareIfNotPossible();
|
||||
|
||||
return { move, captured, oldEpSquare, oldCastlingRights };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user