aboutsummaryrefslogtreecommitdiff
path: root/src/moves.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-27 10:26:54 +0200
committerAdam <adammegarules1@gmail.com>2026-07-27 10:26:54 +0200
commit658a797ec8cb5b6d8607fac089e036685f2a3958 (patch)
tree2de2efc25079b74ab4cf8cdcba9ea5c4e0469ece /src/moves.cpp
parent9b1665430fd0379db92000740c7a70045baa1746 (diff)
adding enpassant
Diffstat (limited to 'src/moves.cpp')
-rw-r--r--src/moves.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/moves.cpp b/src/moves.cpp
index 7efd00a..81ea1df 100644
--- a/src/moves.cpp
+++ b/src/moves.cpp
@@ -70,6 +70,11 @@ void GeneratePawnMoves(Board *b, int from, std::vector<Move> &moves) {
}
int target = (position.rank + (pawn.color ? -1 : 1)) * 8 + targetFile;
+
+ if (IndexToPosition(target) == b->enPassant && b->canEnpassant) {
+ // enpasstant!!!!!!!
+ moves.push_back({position, IndexToPosition(target)});
+ }
if (b->pieces[target].type != NONE &&
b->pieces[target].color != pawn.color) {
moves.push_back({position, IndexToPosition(target)});