From: Benjamin Auder Date: Sat, 20 Mar 2021 17:12:25 +0000 (+0100) Subject: Typos X-Git-Url: https://git.auder.net/css/vendor/%7B%7B%20path%28%27mixstore_static_policy%27%29%20%7D%7D?a=commitdiff_plain;h=500dbd2c68ab7c284a25aa6d496a67315b7ab492;p=vchess.git Typos --- diff --git a/client/src/variants/Teleport1.js b/client/src/variants/Teleport1.js index faa503ac..d9222eac 100644 --- a/client/src/variants/Teleport1.js +++ b/client/src/variants/Teleport1.js @@ -1,7 +1,7 @@ import { ChessRules, Move, PiPo } from "@/base_rules"; import { randInt } from "@/utils/alea"; -export class TeleportRules extends ChessRules { +export class Teleport1Rules extends ChessRules { hoverHighlight([x, y]) { // Testing move validity results in an infinite update loop. 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 &&