fix: Correct DOM element IDs for move history and captured pieces #5

Manually merged
Weyoun merged 4 commits from fix/dom-element-id-mismatches into main 2025-11-23 14:46:58 +00:00
Showing only changes of commit 8390862a73 - Show all commits

View File

@ -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())) {