Only run autorun if it exists

This commit is contained in:
Simon Robertshaw 2012-10-05 16:04:55 +01:00
parent 5c59b9d6cb
commit 0fbe12772d

View File

@ -303,11 +303,10 @@ tpt.partsdata = nil");
void LuaScriptInterface::Init() void LuaScriptInterface::Init()
{ {
if(Client::Ref().FileExists("autorun.lua"))
if(luacon_eval("dofile(\"autorun.lua\")")) if(luacon_eval("dofile(\"autorun.lua\")"))
{
luacon_ci->Log(CommandInterface::LogError, luacon_geterror()); luacon_ci->Log(CommandInterface::LogError, luacon_geterror());
} }
}
void LuaScriptInterface::SetWindow(ui::Window * window) void LuaScriptInterface::SetWindow(ui::Window * window)
{ {