X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=393b9ccf41a8d50ad9912113e8188a563f0b0588;hb=c4f91d3ff756bf1c8948433e0584e0e4235f3524;hp=68fa83a2bf3c220795ff71549ebd6577a6e43cb1;hpb=8a7452b520dc7ead6880a7e62e7c0e057db1ebda;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 68fa83a2..393b9ccf 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -175,11 +175,11 @@ export default { this.play(move); }, 250); }, - play: function(move, programmatic) { + play: function(move, receive, noanimate) { const navigate = !move; // Forbid playing outside analyze mode when cursor isn't at moves.length-1 // (except if we receive opponent's move, human or computer) - if (!navigate && !this.analyze && !programmatic + if (!navigate && !this.analyze && !receive && this.cursor < this.moves.length-1) { return; @@ -190,17 +190,17 @@ export default { return; //no more moves move = this.moves[this.cursor+1]; } - else - { - move.color = this.vr.turn; - move.notation = this.vr.getNotation(move); - } - if (!!programmatic) //computer or (remote) human opponent + if (!!receive && !noanimate) //opponent move, variant != "Dark" { if (this.cursor < this.moves.length-1) this.gotoEnd(); //required to play the move return this.animateMove(move); } + if (!navigate) + { + move.color = this.vr.turn; + move.notation = this.vr.getNotation(move); + } // Not programmatic, or animation is over this.vr.play(move); this.cursor++;