From 193a04e0c027b3bec3f04a9d30a1eb2c526cf8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=92=9C=20Rodney=2C=20An=20Imaginative=20Furball=20?= =?UTF-8?q?=F0=9F=92=99?= Date: Wed, 13 Aug 2025 17:32:35 -0400 Subject: [PATCH 1/2] Update MainState.hx --- source/funkin/backend/system/MainState.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/funkin/backend/system/MainState.hx b/source/funkin/backend/system/MainState.hx index 3b78f47ef..7f744273f 100644 --- a/source/funkin/backend/system/MainState.hx +++ b/source/funkin/backend/system/MainState.hx @@ -91,6 +91,7 @@ class MainState extends FlxState { } } + funkin.backend.scripting.Script.staticVariables = []; for (addon in _lowPriorityAddons) loadLib(addon.path, ltrim(addon.name, "[LOW]")); From 56310dfee7d8aa301829a0f531423c5838fb18cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:07:01 +0200 Subject: [PATCH 2/2] using clear() --- source/funkin/backend/system/MainState.hx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/funkin/backend/system/MainState.hx b/source/funkin/backend/system/MainState.hx index 7f744273f..6762652dc 100644 --- a/source/funkin/backend/system/MainState.hx +++ b/source/funkin/backend/system/MainState.hx @@ -66,12 +66,12 @@ class MainState extends FlxState { ) ]; - for(path in addonPaths) { + for (path in addonPaths) { if (path == null) continue; if (!isDirectory(path)) continue; - for(addon in FileSystem.readDirectory(path)) { - if(!FileSystem.isDirectory(path + addon)) { + for (addon in FileSystem.readDirectory(path)) { + if (!FileSystem.isDirectory(path + addon)) { switch(Path.extension(addon).toLowerCase()) { case 'zip': addon = Path.withoutExtension(addon); @@ -90,8 +90,11 @@ class MainState extends FlxState { else _noPriorityAddons.insert(0, data); } } + #end + + funkin.backend.scripting.Script.staticVariables.clear(); - funkin.backend.scripting.Script.staticVariables = []; + #if MOD_SUPPORT for (addon in _lowPriorityAddons) loadLib(addon.path, ltrim(addon.name, "[LOW]")); @@ -144,4 +147,4 @@ class MainState extends FlxState { FlxG.switchState(cast Type.createInstance(startState, [])); } -} \ No newline at end of file +}