Clear Static Vars Map on Mod Switch (#740)
* Update MainState.hx * using clear() --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
This commit is contained in:
co-authored by
⍚~Nex
parent
f9402fe826
commit
356607f53a
@@ -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,7 +90,11 @@ class MainState extends FlxState {
|
||||
else _noPriorityAddons.insert(0, data);
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
funkin.backend.scripting.Script.staticVariables.clear();
|
||||
|
||||
#if MOD_SUPPORT
|
||||
for (addon in _lowPriorityAddons)
|
||||
loadLib(addon.path, ltrim(addon.name, "[LOW]"));
|
||||
|
||||
@@ -143,4 +147,4 @@ class MainState extends FlxState {
|
||||
|
||||
FlxG.switchState(cast Type.createInstance(startState, []));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user