Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_promotionDialog pops up even if there is no promotion #38

Open
dkwach opened this issue Sep 10, 2024 · 0 comments
Open

_promotionDialog pops up even if there is no promotion #38

dkwach opened this issue Sep 10, 2024 · 0 comments

Comments

@dkwach
Copy link

dkwach commented Sep 10, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant