From b749f10957dc5b7dcd775e1af3aea0560b9b21b4 Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Fri, 13 Aug 2021 14:54:26 -0700 Subject: [PATCH] fix deleting not removing selected boxes --- source/ChartingState.hx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 2c6f9af..c44e4b5 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -2719,6 +2719,7 @@ class ChartingState extends MusicBeatState var box = new ChartingBox(note.x,note.y,note); box.connectedNoteData = i; selectedBoxes.add(box); + note.charterSelected = true; curSelectedNoteObject.charterSelected = true; } @@ -2763,18 +2764,14 @@ class ChartingState extends MusicBeatState if (note.sustainLength > 0) curRenderedSustains.remove(note.noteCharterObject); - if (note.charterSelected) + for(i in 0...selectedBoxes.members.length) { - note.charterSelected = false; - for(i in 0...selectedBoxes.members.length) + var box = selectedBoxes.members[i]; + if (box.connectedNote == note) { - var box = selectedBoxes.members[i]; - if (box.connectedNote == note) - { - selectedBoxes.members.remove(box); - box.destroy(); - return; - } + selectedBoxes.members.remove(box); + box.destroy(); + return; } } }