X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FAntiking.js;fp=public%2Fjavascripts%2Fvariants%2FAntiking.js;h=25a9dfcd0fc3da080512f3859f1086cf1136f53b;hb=388e4c401f05b1f6a4c54e33c9da9114969a53c0;hp=e4d402cef2ffd3167e48a31607d1850121efa1f5;hpb=375ecdd1387e729f85ed114e82253469e4849869;p=vchess.git diff --git a/public/javascripts/variants/Antiking.js b/public/javascripts/variants/Antiking.js index e4d402ce..25a9dfcd 100644 --- a/public/javascripts/variants/Antiking.js +++ b/public/javascripts/variants/Antiking.js @@ -113,8 +113,8 @@ class AntikingRules extends ChessRules updateVariables(move) { super.updateVariables(move); - const piece = this.getPiece(move.start.x,move.start.y); - const c = this.getColor(move.start.x,move.start.y); + const piece = move.vanish[0].p; + const c = move.vanish[0].c; // Update antiking position if (piece == V.ANTIKING) { @@ -126,8 +126,8 @@ class AntikingRules extends ChessRules unupdateVariables(move) { super.unupdateVariables(move); - const c = this.getColor(move.start.x,move.start.y); - if (this.getPiece(move.start.x,move.start.y) == V.ANTIKING) + const c = move.vanish[0].c; + if (move.vanish[0].p == V.ANTIKING) this.antikingPos[c] = [move.start.x, move.start.y]; }