1
0

Merge pull request #517 from derouinw/master

Add missing plugin error
This commit is contained in:
Mattes D 2014-01-08 23:51:32 -08:00
commit 91d70b87e5

View File

@ -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))