const playSubmove = (smove) => {
if (!navigate) smove.notation = this.vr.getNotation(smove);
this.vr.play(smove);
- // Is opponent in check?
- this.incheck = this.vr.getCheckSquares(this.vr.turn);
+ this.lastMove = smove;
if (!navigate) {
if (!this.inMultimove) {
if (this.cursor < this.moves.length - 1)
if (!smove.fen)
// NOTE: only FEN of last sub-move is required (thus setting it here)
smove.fen = this.vr.getFen();
- this.lastMove = smove;
+ // Is opponent in check?
+ this.incheck = this.vr.getCheckSquares(this.vr.turn);
this.emitFenIfAnalyze();
this.inMultimove = false;
if (!noemit) {
if (this.cursor < minCursor) return; //no more moves
move = this.moves[this.cursor];
}
- // Caution; if multi-move, undo all submoves from last to first
undoMove(move, this.vr);
if (light) this.cursor--;
else {