diff options
Diffstat (limited to 'src/board/fen.cpp')
| -rw-r--r-- | src/board/fen.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/board/fen.cpp b/src/board/fen.cpp index 5f27e68..73201b8 100644 --- a/src/board/fen.cpp +++ b/src/board/fen.cpp @@ -32,6 +32,11 @@ static void updateBitboards(Game *g) { g->PieceBitboard = g->WhitePieceBitboard | g->BlackPieceBitboard; } static void SetPiece(int i, PieceType type, bool color, Game *g) { + if (i < 0 || i >= 64) { + std::println("Fatal: piece outside board"); + assert(false && "Malformed board"); + exit(1); + } g->pieces[i] = {.color = color, .type = type}; } |
