if (this.subTurn == 1) {
return moves.filter(m => {
// A move is valid either if it doesn't result in a check,
if (this.subTurn == 1) {
return moves.filter(m => {
// A move is valid either if it doesn't result in a check,
// For now it would then return [NaN, NaN] because surrounding squares
// have no IDs in the promotion modal. TODO: improve this?
if (!square[0]) return null;
// For now it would then return [NaN, NaN] because surrounding squares
// have no IDs in the promotion modal. TODO: improve this?
if (!square[0]) return null;
this.disaggregateFlags(JSON.parse(move.flags));
V.UndoOnBoard(this.board, move);
if (this.subTurn == 1) {
this.disaggregateFlags(JSON.parse(move.flags));
V.UndoOnBoard(this.board, move);
if (this.subTurn == 1) {