X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FSwitching.js;h=67078f536202aa55885ae8d9621906b1419d0607;hb=26c1e3bd4d3e9fb7c86e25c0f423bea57b977111;hp=53b14d58e2e1f0eb8e13fffd5f397306dd8b7086;hpb=f6dbe8e31a3260487664f1e0b50710b3f3efaf5f;p=vchess.git diff --git a/public/javascripts/variants/Switching.js b/public/javascripts/variants/Switching.js index 53b14d58..67078f53 100644 --- a/public/javascripts/variants/Switching.js +++ b/public/javascripts/variants/Switching.js @@ -130,11 +130,7 @@ class SwitchingRules extends ChessRules if (move.appear[0].p == V.KING && move.appear[1].p == V.ROOK) return (move.end.y < move.start.y ? "0-0-0" : "0-0"); // Switch: - const startSquare = - String.fromCharCode(97 + move.start.y) + (V.size.x-move.start.x); - const finalSquare = - String.fromCharCode(97 + move.end.y) + (V.size.x-move.end.x); - return "S" + startSquare + finalSquare; + return "S" + V.CoordsToSquare(move.start) + V.CoordsToSquare(move.end); } }