Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hscript-improved #13304

Closed
Prev Previous commit
Next Next commit
if u got error in runHaxeCode, it stops executing
no spam in luaDebugGroup when error in onUpdate!
  • Loading branch information
TheLeerName committed Sep 19, 2023
commit 3fd45226d9a75d39806ac6739b8d79d0ea3e1585
12 changes: 9 additions & 3 deletions source/psychlua/HScript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,10 @@ class HScript extends Interp
retVal = retFunc;
}

if (funk.hscript.exception != null)
if (funk.hscript.exception != null) {
funk.hscript.active = false;
FunkinLua.luaTrace('ERROR (${funk.lastCalledFunction}) - ${funk.hscript.exception}', false, false, FlxColor.RED);
}

return retVal;
});
Expand All @@ -211,8 +213,10 @@ class HScript extends Interp

var retVal:Dynamic = funk.hscript.executeFunction(funcToRun, funcArgs);

if (funk.hscript.exception != null)
if (funk.hscript.exception != null) {
funk.hscript.active = false;
FunkinLua.luaTrace('ERROR (${funk.lastCalledFunction}) - ${funk.hscript.exception}', false, false, FlxColor.RED);
}

return retVal;
});
Expand All @@ -232,8 +236,10 @@ class HScript extends Interp
try {
funk.hscript.setVar(libName, c);
}
catch(e)
catch(e) {
funk.hscript.active = false;
FunkinLua.luaTrace('ERROR (${funk.lastCalledFunction}) - $e', false, false, FlxColor.RED);
}
});
#end
}
Expand Down