Skip to content

Commit

Permalink
web: Fix auto-queen promotion not working for black
Browse files Browse the repository at this point in the history
  • Loading branch information
francorbacho committed Jan 9, 2024
1 parent e6bb9e7 commit 9bfc39f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/js/chessboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Chessboard {
if (!destSquareElement || sourceSquareElement == destSquareElement) { return; }

const isPawn = movedPiece.classList.contains("pawn");
const promotion = (isPawn && (row == 8 || row == 0)) ? "q" : "";
const promotion = (isPawn && (row == 8 || row == 1)) ? "q" : "";
const movement = `${sourceSquare}${destSquare}${promotion}`;

try {
Expand Down

0 comments on commit 9bfc39f

Please sign in to comment.