fix: Correct DOM element IDs for move history and captured pieces #5
@ -105,7 +105,8 @@ export class GameController {
|
|||||||
captured = SpecialMoves.executeEnPassant(this.board, piece, toRow, toCol);
|
captured = SpecialMoves.executeEnPassant(this.board, piece, toRow, toCol);
|
||||||
} else {
|
} else {
|
||||||
// Normal move
|
// Normal move
|
||||||
captured = this.board.movePiece(fromRow, fromCol, toRow, toCol);
|
const moveResult = this.board.movePiece(fromRow, fromCol, toRow, toCol);
|
||||||
|
captured = moveResult.captured;
|
||||||
|
|
||||||
// Check for promotion
|
// Check for promotion
|
||||||
if (specialMoveType === 'promotion' || (piece.type === 'pawn' && piece.canPromote())) {
|
if (specialMoveType === 'promotion' || (piece.type === 'pawn' && piece.canPromote())) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user