diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 7f957a4b1e..8c23274864 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -581,11 +581,11 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset var lastIndex = scripts.scripts.indexOf(this.script); if(lastIndex >= 0) { - if(script == null) // last != null && new == null + if(script == null || script is DummyScript) // last != null && new is unusable scripts.scripts.splice(lastIndex, 1); else // last != null && new != null scripts.scripts[lastIndex] = script; - } else if(script != null) // last == null + } else if(script != null && !(script is DummyScript)) // last == null, DummyScripts are never dispatched scripts.insert(0, script); return this.script = script; diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index b57fe0b2bc..d7f868319c 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -2386,8 +2386,11 @@ class PlayState extends MusicBeatState public function addScript(file:String) { var ext = Path.extension(file).toLowerCase(); - if (Script.scriptExtensions.contains(ext)) - scripts.add(Script.create(file)); + if (Script.scriptExtensions.contains(ext)) { + var script = Script.create(file); + if (script is DummyScript) return; + scripts.add(script); + } } // GETTERS & SETTERS diff --git a/source/funkin/game/Stage.hx b/source/funkin/game/Stage.hx index 8f5314db7b..ea205120f5 100644 --- a/source/funkin/game/Stage.hx +++ b/source/funkin/game/Stage.hx @@ -75,7 +75,8 @@ class Stage extends FlxBasic implements IBeatReceiver { public function loadXml(xml:Access, forceLoadAll:Bool = false) { if (PlayState.instance == state) { stageScript = Script.create(Paths.script('data/stages/$stageFile')); - PlayState.instance.scripts.add(stageScript); + if (!(stageScript is DummyScript)) + PlayState.instance.scripts.add(stageScript); stageScript.load(); }