File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ class MusicBeatState extends FlxState implements IBeatReceiver
9393
9494 public var scriptsAllowed : Bool = true ;
9595
96+ public static var lastScriptName : String = null ;
97+ public static var lastStateName : String = null ;
98+
9699 public var scriptName : String = null ;
97100
98101 public static var skipTransOut : Bool = false ;
@@ -108,7 +111,12 @@ class MusicBeatState extends FlxState implements IBeatReceiver
108111 public function new (scriptsAllowed : Bool = true , ? scriptName : String ) {
109112 super ();
110113 this .scriptsAllowed = #if SOFTCODED_STATES scriptsAllowed #else false #end;
111- this .scriptName = scriptName ;
114+
115+ if (lastStateName != (lastStateName = Type .getClassName (Type .getClass (this )))) {
116+ lastScriptName = null ;
117+ }
118+ this .scriptName = scriptName != null ? scriptName : lastScriptName ;
119+ lastScriptName = this .scriptName ;
112120 }
113121
114122 function loadScript () {
You can’t perform that action at this time.
0 commit comments