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