X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FTeleport2.js;h=23bd213643a22cc915de80a87d5a2ac256c583a2;hp=4e0fe23abbe0d9e36bfc41e11855b4890c765baf;hb=500dbd2c68ab7c284a25aa6d496a67315b7ab492;hpb=2173c72f801167a5b42fd68a29971676a212c1b2 diff --git a/client/src/variants/Teleport2.js b/client/src/variants/Teleport2.js index 4e0fe23a..23bd2136 100644 --- a/client/src/variants/Teleport2.js +++ b/client/src/variants/Teleport2.js @@ -13,7 +13,7 @@ export class Teleport2Rules extends Teleport1Rules { } postPlay(move) { - if (move.vaish.length > 0) { + if (move.vanish.length > 0) { // Standard method: if (move.appear[0].p == V.KING) this.kingPos[move.appear[0].c] = [move.appear[0].x, move.appear[0].y]; @@ -23,11 +23,11 @@ export class Teleport2Rules extends Teleport1Rules { updateCastleFlags(move) { // Standard method: TODO = find a better way... (not rewriting) - const c = color || V.GetOppCol(this.turn); + const c = move.vanish[0].c; const firstRank = (c == "w" ? V.size.x - 1 : 0); const oppCol = this.turn; const oppFirstRank = V.size.x - 1 - firstRank; - if (piece == V.KING && move.appear.length > 0) + if (move.vanish[0].p == V.KING && move.appear.length > 0) this.castleFlags[c] = [V.size.y, V.size.y]; else if ( move.start.x == firstRank &&