Fix bug that did not delete the pawn taken by enPassant.
This commit is contained in:
parent
9fbffc61f9
commit
72faedc000
@ -122,7 +122,8 @@ func (p *Pawn) HandleEnPassant(b *Board, move, lastMove types.Move) (bool, error
|
||||
}
|
||||
|
||||
if wasEnPassant { //play the move
|
||||
delete(b.position, lastMove.EndSquare)
|
||||
delete(b.position, lastMove.EndSquare) // take opponent's pawn
|
||||
delete(b.position, move.StartSquare) // move moving pawn
|
||||
b.position[move.EndSquare] = GetPieceForShortName(move.PieceMoved)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user