[Board] Reformat handlePawnDoubleAdvance
This commit is contained in:
@@ -132,13 +132,18 @@ void Board::handlePawnDoubleAdvance(const Move &move, BitBoard bb, const Piece &
|
||||
if (movedPiece.type() == PieceType::Pawn) {
|
||||
auto fromR = move.from().rank();
|
||||
auto toR = move.to().rank();
|
||||
auto diff = abs(static_cast<int>(fromR) - static_cast<int>(toR));
|
||||
if (diff == 2 && (mPieceBBs[toIndex(PieceType::Pawn)] & (bb.left(1) | bb.right(1)) & BitBoard::getRank(static_cast<int>(toR)))) {
|
||||
if (abs(static_cast<int>(fromR) - static_cast<int>(toR)) == 2) {
|
||||
if (mPieceBBs[toIndex(PieceType::Pawn)]
|
||||
& (bb.left(1) | bb.right(1))
|
||||
& BitBoard::getRank(static_cast<int>(toR))) {
|
||||
|
||||
mEPS = Square::fromCoordinates(move.to().file(), std::max(fromR, toR) - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mEPS = std::nullopt;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user