aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-10 15:28:21 +0200
committerAdam <adammegarules1@gmail.com>2026-08-10 15:28:21 +0200
commit17fcc2cba9bf5fa6b52ce4eef7f96ce390c6a662 (patch)
treeccf84fee0541c53b60eafd6373a9fbf7cbfd11fe /src
parentfa99aa2d53eb1f784b6e7bb4971cf36092488957 (diff)
fixing and updating
Diffstat (limited to 'src')
-rw-r--r--src/board/fen.cpp5
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};
}