X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FCheckered.js;h=a74143b9c21e89424d96318981d4ef1d71fc8053;hp=3626822bfbfed1ef2cc538a0931c90d8a57a65e1;hb=cd4cad0468612cf00c6e6879554e3cee58d4b1f9;hpb=ea8417ff95096f626fae0286135d875a9c043e11 diff --git a/public/javascripts/variants/Checkered.js b/public/javascripts/variants/Checkered.js index 3626822b..a74143b9 100644 --- a/public/javascripts/variants/Checkered.js +++ b/public/javascripts/variants/Checkered.js @@ -338,11 +338,13 @@ class CheckeredRules extends ChessRules getCheckSquares(move, c) { this.play(move); + this.moves.push(move); //artifically change turn, for checkered pawns (TODO) const kingAttacked = this.isAttacked(this.kingPos[c], this.getOppCol(c)) || this.isAttacked(this.kingPos[c], 'c'); let res = kingAttacked ? [ JSON.parse(JSON.stringify(this.kingPos[c])) ] //need to duplicate! : [ ]; + this.moves.pop(); this.undo(move); return res; }