X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=fb4564f7f2c3a0de46a52d3ffaa0bbcb2bcbf503;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=0d9322e2962b683d6c93ed2341c60798b2f52e42;hpb=97da8720d3f33cb0c29079baf42c52ed047c3049;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 0d9322e2..fb4564f7 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -120,7 +120,7 @@ Vue.component('my-game', { this.loadGame(); else if (!!this.fen) { - this.vr = new VariantRules(this.fen); + this.vr = new V(this.fen); this.fenStart = this.fen; } // TODO: if I'm one of the players in game, then: @@ -296,7 +296,7 @@ Vue.component('my-game', { }, translate: translate, newGameFromFen: function() { - this.vr = new VariantRules(this.fen); + this.vr = new V(this.fen); this.moves = []; this.cursor = -1; this.fenStart = this.fen; @@ -490,7 +490,7 @@ Vue.component('my-game', { if (this.cursor == this.moves.length) this.moves.push(move); else - this.moves = this.moves.slice(0,this.cursor-1).concat([move]); + this.moves = this.moves.slice(0,this.cursor).concat([move]); } // Is opponent in check? this.incheck = this.vr.getCheckSquares(this.vr.turn); @@ -532,12 +532,12 @@ Vue.component('my-game', { this.moves.pop(); }, gotoMove: function(index) { - this.vr = new VariantRules(this.moves[index].fen); + this.vr = new V(this.moves[index].fen); this.cursor = index; this.lastMove = this.moves[index]; }, gotoBegin: function() { - this.vr = new VariantRules(this.fenStart); + this.vr = new V(this.fenStart); this.cursor = -1; this.lastMove = null; },