aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter B. <peter.bezdek@gmail.com>2026-08-08 18:07:18 +0200
committerPeter B. <peter.bezdek@gmail.com>2026-08-08 18:07:18 +0200
commit029948d2cf6bfb8001d5d9a66df6ce38c8eee789 (patch)
tree9be31d2c925906864703f95f38d120e8c6735553
parent4612e164c6126cfcd6e83f7c02353a50e9bec9cb (diff)
fix: en passant bug
-rw-r--r--.gitignore1
-rw-r--r--src/board/board.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 3fe970c..6d7d4a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
build/
+build-release/
tmp/
tmp
.cache/
diff --git a/src/board/board.cpp b/src/board/board.cpp
index 7b53a1b..82b0d7f 100644
--- a/src/board/board.cpp
+++ b/src/board/board.cpp
@@ -82,11 +82,11 @@ UndoMove MakeMove(Move move, Game *g) {
// Adding enpassant
if (piece.type == PAWN) {
Position to = move.To;
- to.rank -= static_cast<uint8_t>(piece.color ? 2 : -2);
+ to.rank -= piece.color ? 2 : -2;
if (to == move.From) {
g->canEnpassant = true;
Position target = move.From;
- target.rank += static_cast<uint8_t>(piece.color ? 1 : -1);
+ target.rank += piece.color ? 1 : -1;
g->enPassant = target;
};
}