mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fix error cascade when one mod has script errors
This commit is contained in:
parent
174e3d97ed
commit
d206581c87
1 changed files with 4 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ int smlua_error_handler(UNUSED lua_State* L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int smlua_pcall(lua_State* L, int nargs, int nresults, UNUSED int errfunc) {
|
int smlua_pcall(lua_State* L, int nargs, int nresults, UNUSED int errfunc) {
|
||||||
|
gSmLuaConvertSuccess = true;
|
||||||
lua_pushcfunction(L, smlua_error_handler);
|
lua_pushcfunction(L, smlua_error_handler);
|
||||||
int errorHandlerIndex = 1;
|
int errorHandlerIndex = 1;
|
||||||
lua_insert(L, errorHandlerIndex);
|
lua_insert(L, errorHandlerIndex);
|
||||||
|
|
@ -60,6 +61,9 @@ static void smlua_exec_str(char* str) {
|
||||||
static void smlua_load_script(struct Mod* mod, struct ModFile* file, u16 remoteIndex) {
|
static void smlua_load_script(struct Mod* mod, struct ModFile* file, u16 remoteIndex) {
|
||||||
lua_State* L = gLuaState;
|
lua_State* L = gLuaState;
|
||||||
|
|
||||||
|
lua_settop(L, 0);
|
||||||
|
|
||||||
|
gSmLuaConvertSuccess = true;
|
||||||
gLuaInitializingScript = 1;
|
gLuaInitializingScript = 1;
|
||||||
if (luaL_loadfile(L, file->cachedPath) != LUA_OK) {
|
if (luaL_loadfile(L, file->cachedPath) != LUA_OK) {
|
||||||
LOG_LUA("Failed to load lua script '%s'.", file->cachedPath);
|
LOG_LUA("Failed to load lua script '%s'.", file->cachedPath);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue