From 12d38d0f53f4ab534e44467550b72705858810d4 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Sat, 4 Apr 2020 00:16:47 +0200 Subject: [PATCH] Fix double-move sending in corr games --- client/src/views/Game.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 8b5ca8b6..398a0a27 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -1451,9 +1451,12 @@ export default { } ); // PlayOnBoard is enough, and more appropriate for Synchrone Chess - V.PlayOnBoard(this.vr.board, move); + const arMove = (Array.isArray(move) ? move : [move]); + for (let i = 0; i < arMove.length; i++) + V.PlayOnBoard(this.vr.board, arMove[i]); const position = this.vr.getBaseFen(); - V.UndoOnBoard(this.vr.board, move); + for (let i = arMove.length - 1; i >= 0; i--) + V.UndoOnBoard(this.vr.board, arMove[i]); if (["all","byrow"].includes(V.ShowMoves)) { this.curDiag = getDiagram({ position: position, -- 2.44.0