added en passant
This commit is contained in:
1 parent
2d777be0a5
commit
9534a787f9
2 files changed
+16
-4
No files matched your search
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user