projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implementation of pieces movements + captures in Ultima
[vchess.git]
/
public
/
javascripts
/
base_rules.js
diff --git
a/public/javascripts/base_rules.js
b/public/javascripts/base_rules.js
index
8de0176
..
5020094
100644
(file)
--- a/
public/javascripts/base_rules.js
+++ b/
public/javascripts/base_rules.js
@@
-729,6
+729,10
@@
class ChessRules
play(move, ingame)
{
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)];
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));
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();
}
//////////////
}
//////////////