X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=e70b9de88eef4caf811de25ad45aa69fbf5b1654;hp=e0353e8f8a5f29b1917dd9b93982227fdc3bd22b;hb=964eda04ad6415b4ec95387ea08b63a3d0f0f9cc;hpb=032ecd58543d1182b41da0c45b272e99a3014ad8 diff --git a/client/src/base_rules.js b/client/src/base_rules.js index e0353e8f..e70b9de8 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -1202,10 +1202,8 @@ export const ChessRules = class ChessRules { piece = move.appear[0].p; // Update king position + flags - if (piece == V.KING && move.appear.length > 0) { - this.kingPos[c][0] = move.appear[0].x; - this.kingPos[c][1] = move.appear[0].y; - } + if (piece == V.KING && move.appear.length > 0) + this.kingPos[c] = [move.appear[0].x, move.appear[0].y]; if (V.HasCastle) this.updateCastleFlags(move, piece); }