case V.KING:
// Do not allow castling to escape from check
oppMoves = super.getSlideNJumpMoves(
- sq,
+ [i, j],
V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
"oneStep"
);
break;
}
for (let om of oppMoves) {
- if (om.vanish.length == 2 && om.appear.length == 1)
+ if (om.vanish.length == 2)
// Skip captures: forbidden in this mode
continue;
V.PlayOnBoard(this.board, om);
}
}
}
+ this.undo(m);
// 3) Add mate-captures:
Object.values(attacked).forEach(sq => {
p: this.getPiece(sq[0], sq[1])
}));
});
-
- this.undo(m);
});
return moves;