Skip to content

Commit

Permalink
Fixed "Tried to call a non-function" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowMario committed Sep 15, 2024
1 parent 66b9225 commit 5841809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/psychlua/HScript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class HScript extends Iris
return null;
}

public function executeFunction(funcToRun:String = null, funcArgs:Array<Dynamic>):IrisCall {
public function executeFunction(funcToRun:String = null, funcArgs:Array<Dynamic> = null):IrisCall {
if (funcToRun == null || !exists(funcToRun)) return null;
return call(funcToRun, funcArgs);
}
Expand Down
4 changes: 2 additions & 2 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ class PlayState extends MusicBeatState
for (script in hscriptArray)
if(script != null)
{
script.call('onDestroy');
script.executeFunction('onDestroy');
script.destroy();
}

Expand Down Expand Up @@ -3260,7 +3260,7 @@ class PlayState extends MusicBeatState
try
{
newScript = new HScript(null, file);
newScript.call('onCreate');
newScript.executeFunction('onCreate');
trace('initialized hscript interp successfully: $file');
hscriptArray.push(newScript);
}
Expand Down

0 comments on commit 5841809

Please sign in to comment.