X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FSwitching.js;h=53b14d58e2e1f0eb8e13fffd5f397306dd8b7086;hb=388e4c401f05b1f6a4c54e33c9da9114969a53c0;hp=e53ab6926d9e5e7be2b70bed410d7db70e4d3656;hpb=375ecdd1387e729f85ed114e82253469e4849869;p=vchess.git diff --git a/public/javascripts/variants/Switching.js b/public/javascripts/variants/Switching.js index e53ab692..53b14d58 100644 --- a/public/javascripts/variants/Switching.js +++ b/public/javascripts/variants/Switching.js @@ -104,7 +104,7 @@ class SwitchingRules extends ChessRules && move.appear[1].p == V.KING) { // Switch with the king; not castle, and not handled by main class - const color = this.getColor(move.start.x, move.start.y); + const color = move.vanish[0].c; this.kingPos[color] = [move.appear[1].x, move.appear[1].y]; } } @@ -115,7 +115,7 @@ class SwitchingRules extends ChessRules if (move.appear.length == 2 && move.vanish.length == 2 && move.appear[1].p == V.KING) { - const color = this.getColor(move.start.x, move.start.y); + const color = move.vanish[0].c; this.kingPos[color] = [move.appear[0].x, move.appear[0].y]; } }