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.moves.pop();
this.unupdateVariables(move);
this.parseFlags(JSON.parse(move.flags));
+
+ // DEBUG:
+// let state = this.states.pop();
+// if (JSON.stringify(this.board) != state)
+// debugger;
}
//////////////
});
}
// Fix en-passant captures
- if (m.vanish.length == 2 && this.board[m.end.x][m.end.y] == VariantRules.EMPTY)
+ if (m.vanish[0].p == VariantRules.PAWN
+ && m.vanish.length == 2 && this.board[m.end.x][m.end.y] == VariantRules.EMPTY)
{
m.vanish[1].c = this.getOppCol(this.getColor(x,y));
// In the special case of en-passant, if