From 2baac0e983020bebbad108f455d5991a227890da Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sat, 17 Feb 2024 04:21:03 -0500 Subject: [PATCH] dont infinitely add new props, replace the old ones --- source/funkin/ui/story/StoryMenuState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index 42b55f9cb..bd7a05f91 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -632,10 +632,10 @@ class StoryMenuState extends MusicBeatState function updateProps():Void { - for (prop in currentLevel.buildProps(levelProps.members)) + for (ind => prop in currentLevel.buildProps(levelProps.members)) { prop.zIndex = 1000; - levelProps.add(prop); + if (levelProps.members[ind] != prop) levelProps.replace(levelProps.members[ind], prop) ?? levelProps.add(prop); } refresh();