X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=5020094ce6582c326473acbc74f1e1b9b1901348;hb=a3c86ec9b60326a8ae3d8f237493fb09627aed95;hp=8de0176c78b73a8fb6011d369bbba3dbdc74d465;hpb=7688bf7781d10bdf7db2ff558a35852bebcaae53;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index 8de0176c..5020094c 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -729,6 +729,10 @@ class ChessRules play(move, ingame) { + // DEBUG: +// if (!this.states) this.states = []; +// if (!ingame) this.states.push(JSON.stringify(this.board)); + if (!!ingame) move.notation = [this.getNotation(move), this.getLongNotation(move)]; @@ -746,6 +750,11 @@ class ChessRules this.moves.pop(); this.unupdateVariables(move); this.parseFlags(JSON.parse(move.flags)); + + // DEBUG: +// if (JSON.stringify(this.board) != this.states[this.states.length-1]) +// debugger; +// this.states.pop(); } //////////////