From fe2e76b3f0228f3dd9f33e6d5b55bc9701abb660 Mon Sep 17 00:00:00 2001 From: Joalor64 Date: Tue, 12 Nov 2024 10:40:52 -0500 Subject: [PATCH] something i guess --- source/states/ScriptedState.hx | 8 ++++++-- source/substates/ScriptedSubState.hx | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/source/states/ScriptedState.hx b/source/states/ScriptedState.hx index a9881b3..e3ea9f7 100644 --- a/source/states/ScriptedState.hx +++ b/source/states/ScriptedState.hx @@ -26,8 +26,12 @@ class ScriptedState extends ExtendableState { #end for (folder in folders) { - if (FileSystem.exists(Paths.script(folder + path))) { - path = Paths.script(folder + path); + if (FileSystem.exists(folder)) { + for (file in FileSystem.readDirectory(folder)) { + if (file.startsWith(path) && file.endsWith('.hxs')) { + path = folder + file; + } + } } } diff --git a/source/substates/ScriptedSubState.hx b/source/substates/ScriptedSubState.hx index aa26fc2..7f31467 100644 --- a/source/substates/ScriptedSubState.hx +++ b/source/substates/ScriptedSubState.hx @@ -20,8 +20,12 @@ class ScriptedSubState extends ExtendableSubState { #end for (folder in folders) { - if (FileSystem.exists(Paths.script(folder + path))) { - path = Paths.script(folder + path); + if (FileSystem.exists(folder)) { + for (file in FileSystem.readDirectory(folder)) { + if (file.startsWith(path) && file.endsWith('.hxs')) { + path = folder + file; + } + } } }