flutter_chess_board icon indicating copy to clipboard operation
flutter_chess_board copied to clipboard

_promotionDialog pops up even if there is no promotion

Open dkwach opened this issue 1 year ago • 0 comments

logic, which fires _promotionDialog is incorrect:

 if (pieceMoveData.pieceType == "P" &&
                ((pieceMoveData.squareName[1] == "7" &&
                        squareName[1] == "8" &&
                        pieceMoveData.pieceColor == Color.WHITE) ||
                    (pieceMoveData.squareName[1] == "2" &&
                        squareName[1] == "1" &&
                        pieceMoveData.pieceColor == Color.BLACK))) {
              var val = await _promotionDialog(context);

It will run _promotionDialog even if

  • game is in check state
  • pawn is moved to occupied promotion field by the same color

dkwach avatar Sep 10 '24 14:09 dkwach