From 288fcafda2f32299eca8c8528636f2677e4d6d9f Mon Sep 17 00:00:00 2001 From: Vasileios Pasialiokis <whiterocket@outlook.com> Date: Sun, 15 Apr 2018 21:28:58 +0300 Subject: [PATCH] twine js sync --- devNotes/twine JS | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/devNotes/twine JS b/devNotes/twine JS index fc97687892d..bbe5727bd65 100644 --- a/devNotes/twine JS +++ b/devNotes/twine JS @@ -6872,13 +6872,9 @@ window.addSlave = function addSlave(slave) { }; window.removeSlave = function removeSlave(index) { - delete State.variables.slaveIndices[State.variables.slaves[index].ID]; - for (var key in State.variables.slaveIndices) { - if (State.variables.slaveIndices[key] > index) { - State.variables.slaveIndices[key] -= 1; - } - } - return State.variables.slaves.deleteAt(index); + const ret = State.variables.slaves.deleteAt(index); + State.variables.slaveIndices = slaves2indices(); + return ret; }; window.slaves2indices = function slaves2indices() { @@ -9258,4 +9254,4 @@ window.setColors = function(colorMap){ } }); }); -} \ No newline at end of file +} -- GitLab