Update MusicBeatState.hx

This commit is contained in:
Yoshman29
2022-11-10 15:54:34 +01:00
parent 54c66886bf
commit 38d2a767aa
+10 -6
View File
@@ -81,12 +81,16 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver
function loadScript() {
if (scriptsAllowed) {
var className = Type.getClassName(Type.getClass(this));
var scriptName = className.substr(className.lastIndexOf(".")+1);
stateScript = Script.create(Paths.script('data/states/${scriptName}'));
stateScript.setParent(this);
stateScript.load();
if (stateScript == null || stateScript is DummyScript) {
var className = Type.getClassName(Type.getClass(this));
var scriptName = className.substr(className.lastIndexOf(".")+1);
stateScript = Script.create(Paths.script('data/states/${scriptName}'));
stateScript.setParent(this);
stateScript.load();
} else {
stateScript.reload();
}
}
}
override function create()