X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=4162dfcabb81f5e50dc13b49428252bbda8fb96d;hb=8be8238cbd8bd1eeeb4c101648d6902cae425f7b;hp=c85d47e991d4518e75cefe2d43f23fa337b719db;hpb=3a2a7b5fd3c6bfd0752838094c27e1fb6172d109;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index c85d47e9..4162dfca 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -291,7 +291,7 @@ export default { if (this.game.mode == "analyze") { this.$emit( "fenchange", - this.lastMove ? this.lastMove.fen : this.game.fenStart + !!this.lastMove ? this.lastMove.fen : this.game.fenStart ); } }, @@ -309,8 +309,7 @@ export default { 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) @@ -356,7 +355,8 @@ export default { 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) { @@ -442,7 +442,6 @@ export default { 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 {