[Board] Add check for Optional
This commit is contained in:
@@ -51,6 +51,8 @@ CastlingRights Board::castlingRights() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Board::setEnPassantSquare(const Square::Optional &square) {
|
void Board::setEnPassantSquare(const Square::Optional &square) {
|
||||||
|
if (!square.has_value())
|
||||||
|
return;
|
||||||
mEPS = square->index();
|
mEPS = square->index();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user