When using the
SMW Utilities script, it runs normally. But when I untoggle and re-toggle (not the reload button) I get the following error:
LuaInterface.LuaException: unprotected error in call to Lua API (0)
in LuaInterface.Lua.PanicCallback(IntPtr luaState)
in lua_error(lua_State* )
in LuaInterface.ObjectTranslator.throwError(IntPtr luaState, Object e)
in LuaInterface.Lua.SetPendingException(Exception e)
in LuaInterface.LuaMethodWrapper.SetPendingException(Exception e)
in LuaInterface.LuaMethodWrapper.call(IntPtr luaState)
in LuaInterface.MetaFunctions.runFunctionDelegate(IntPtr luaState)
in lua_resume(lua_State* , Int32 )
in BizHawk.Client.EmuHawk.EmuLuaLibrary.ResumeScript(Lua script)
in BizHawk.Client.EmuHawk.LuaConsole.<>c__DisplayClass3c.<ResumeScripts>b__35()
in BizHawk.Client.Common.EnvironmentSandbox.Sandbox(Action callback)
in BizHawk.Client.Common.LuaSandbox.Sandbox(Action callback, Action exceptionCallback)
I get this with v.1.12.0, but not with previous versions. Also, this error doesn't happen with non-modular scripts (this SMW one has a lot of modules). Maybe it's related with how BizHawk handles modules, by not closing them when the script is off/reloading.