From 0fbe12772dfb28abb491ac0b5a51854de8a30b4e Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 5 Oct 2012 16:04:55 +0100 Subject: Only run autorun if it exists diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index fc00e24..39a5add 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -303,10 +303,9 @@ tpt.partsdata = nil"); void LuaScriptInterface::Init() { - if(luacon_eval("dofile(\"autorun.lua\")")) - { - luacon_ci->Log(CommandInterface::LogError, luacon_geterror()); - } + if(Client::Ref().FileExists("autorun.lua")) + if(luacon_eval("dofile(\"autorun.lua\")")) + luacon_ci->Log(CommandInterface::LogError, luacon_geterror()); } void LuaScriptInterface::SetWindow(ui::Window * window) -- cgit v0.9.2-21-gd62e