X-Git-Url: https://git.auder.net/css/rpsls.css?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=dd15f1333dd8cabb6962ee6e4af8837fa1cf6659;hb=7ddfec38b0804bf0bd0c5b5c6972d355902e9fb0;hp=fd26d87204f5c0b9e48743c121c0e36bb792183b;hpb=1ef65040168ab7d55ce921abc9d63644a937d689;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index fd26d872..dd15f133 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -409,6 +409,8 @@ export default { smove.unambiguous = V.GetUnambiguousNotation(smove); this.vr.play(smove); this.lastMove = smove; + // Is opponent (or me) in check? + this.incheck = this.vr.getCheckSquares(this.vr.turn); if (!this.inMultimove) { // Condition is "!navigate" but we mean "!this.autoplay" if (!navigate) { @@ -423,8 +425,7 @@ export default { const L = this.moves.length; if (!Array.isArray(this.moves[L-1])) this.$set(this.moves, L-1, [this.moves[L-1], smove]); - else - this.$set(this.moves, L-1, this.moves.concat([smove])); + else this.moves[L-1].push(smove); } }; const playMove = () => { @@ -471,8 +472,6 @@ export default { if (!smove.fen) // NOTE: only FEN of last sub-move is required (=> setting it here) smove.fen = this.vr.getFen(); - // Is opponent in check? - this.incheck = this.vr.getCheckSquares(this.vr.turn); this.emitFenIfAnalyze(); this.inMultimove = false; this.score = computeScore(); @@ -533,6 +532,8 @@ export default { for (let i=move.length -1; i >= 0; i--) this.vr.undo(move[i]); this.moves.pop(); this.cursor--; + // The board may still show the possible moves: (TODO: bad solution) + this.$refs["board"].resetCurrentAttempt(); this.inMultimove = false; }, cancelLastMove: function() {