mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-31 19:51:45 +02:00
Do not use loadstring to load autorun (who even wrote this?). Also print a message in case of successful autorun load
This commit is contained in:
@@ -335,8 +335,13 @@ tpt.partsdata = nil");
|
|||||||
void LuaScriptInterface::Init()
|
void LuaScriptInterface::Init()
|
||||||
{
|
{
|
||||||
if(Client::Ref().FileExists("autorun.lua"))
|
if(Client::Ref().FileExists("autorun.lua"))
|
||||||
if(luacon_eval("dofile(\"autorun.lua\")"))
|
{
|
||||||
|
lua_State *l = luacon_ci->l;
|
||||||
|
if(luaL_loadfile(l, "autorun.lua") || lua_pcall(l, 0, 0, 0))
|
||||||
luacon_ci->Log(CommandInterface::LogError, luacon_geterror());
|
luacon_ci->Log(CommandInterface::LogError, luacon_geterror());
|
||||||
|
else
|
||||||
|
luacon_ci->Log(CommandInterface::LogNotice, "Loaded autorun.lua");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LuaScriptInterface::SetWindow(ui::Window * window)
|
void LuaScriptInterface::SetWindow(ui::Window * window)
|
||||||
|
Reference in New Issue
Block a user