chess.js
chess.js copied to clipboard
Move with promotion fails on the typescript (dev) branch
I want to set the promotion to "q" as a default but when I run this code on a move not resulting in a promotion
this.chessInstance.move({
from: ...,
to: ...,
promotion: "q",
});
It works on the master branch but not on the dev branch, Is it made on purpose ?
I used the debugger and noticed that the issue comes from here (move function):
(!('promotion' in moves[i]) || move.promotion === moves[i].promotion)) {
in the master branch, moves[i].promotion
does not exist
in the dev branch , moves[i].promotion
is undefined
Thanks for the report @rafalou38. I'm trying to understand this issue more clearly. Are you providing { promotion: 'q' }
even when the move is not a promotion?
Yes, for all the moves.
This should be fixed on the dev
branch. Thanks again for the report.