added en passant

This commit is contained in:
rektdie committed 2024-03-30 22:22:30 +01:00
1 parent 2d777be0a5
commit 9534a787f9
2 files changed
+16 -4

No files matched your search

+2 -2
View File
@@ -290,7 +290,7 @@ void Board::DoMove(Move move) {
int targetType = GetPieceType(move.moveTo);
int direction = attackerColor ? north : south;
int direction = attackerColor ? south : north;
pieces[attackerType].PopBit(move.moveFrom);
colors[attackerColor].PopBit(move.moveFrom);
@@ -303,7 +303,7 @@ void Board::DoMove(Move move) {
} else if (moveType == doublePawnPush) {
occupied.SetBit(move.moveTo);
enPassantTarget = move.moveFrom + direction;
} else if (moveType == capture) {
} else if (moveType == capture || moveType == epCapture) {
pieces[targetType].PopBit(move.moveTo);
colors[!attackerColor].PopBit(move.moveTo);
}