X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FplayUndo.js;h=94e642cc2a3ac49b36b9e05792249654601f8001;hb=b0a0468aa6f436f2ad4962492561ef430a3bc15c;hp=ab11bff96af73714070bfe67c55707c398bc9839;hpb=e71161fbfffe53b0f4b174e0467cdd98cc70b7b0;p=vchess.git diff --git a/client/src/utils/playUndo.js b/client/src/utils/playUndo.js index ab11bff9..94e642cc 100644 --- a/client/src/utils/playUndo.js +++ b/client/src/utils/playUndo.js @@ -5,6 +5,7 @@ export function playMove(move, vr) { export function undoMove(move, vr) { if (!Array.isArray(move)) move = [move]; + // If multi-move, undo all submoves from last to first for (let i = move.length - 1; i >= 0; i--) vr.undo(move[i]); }