diff options
author | Mattes D <github@xoft.cz> | 2014-01-09 08:51:32 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-01-09 08:51:32 +0100 |
commit | 91d70b87e53b1cfb73e17bdce18e059486c979df (patch) | |
tree | 4639ede06ab36b570f25c818677ef4c875f75652 /src | |
parent | Added a known working favicon. (diff) | |
parent | A couple touchups (diff) | |
download | cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.tar cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.tar.gz cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.tar.bz2 cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.tar.lz cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.tar.xz cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.tar.zst cuberite-91d70b87e53b1cfb73e17bdce18e059486c979df.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Bindings/PluginLua.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index 209842e55..eefcd2b09 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -90,6 +90,8 @@ bool cPluginLua::Initialize(void) // Load all files for this plugin, and execute them AStringVector Files = cFile::GetFolderContents(PluginPath.c_str()); + + int numFiles = 0; for (AStringVector::const_iterator itr = Files.begin(); itr != Files.end(); ++itr) { if (itr->rfind(".lua") == AString::npos) @@ -101,9 +103,20 @@ bool cPluginLua::Initialize(void) { Close(); return false; + } + else + { + numFiles++; } } // for itr - Files[] + if (numFiles == 0) + { + LOGWARNING("No lua files found: plugin %s is missing.", GetName().c_str()); + Close(); + return false; + } + // Call intialize function bool res = false; if (!m_LuaState.Call("Initialize", this, cLuaState::Return, res)) |