diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2014-10-20 14:46:24 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2014-10-20 14:46:24 +0200 |
commit | 1a46feda43dff022d5a369fb85612b2670fe97e4 (patch) | |
tree | 6c6dcc0f1f736dde7fd8a0b8440174105bf7ba7e /src/Bindings/PluginManager.cpp | |
parent | Merge pull request #1549 from SphinxC0re/master (diff) | |
download | cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.tar cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.tar.gz cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.tar.bz2 cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.tar.lz cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.tar.xz cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.tar.zst cuberite-1a46feda43dff022d5a369fb85612b2670fe97e4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/PluginManager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 43507a5fb..ef9638339 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -1525,6 +1525,15 @@ bool cPluginManager::DisablePlugin(const AString & a_PluginName) bool cPluginManager::LoadPlugin(const AString & a_PluginName) { + PluginMap map = GetAllPlugins(); + + for(auto plugin_entry : map) + { + if(plugin_entry.first == a_PluginName) + { + return false; + } + } return AddPlugin(new cPluginLua(a_PluginName.c_str())); } @@ -1827,7 +1836,8 @@ bool cPluginManager::DoWithPlugin(const AString & a_PluginName, cPluginCallback bool cPluginManager::AddPlugin(cPlugin * a_Plugin) { - m_Plugins[a_Plugin->GetDirectory()] = a_Plugin; + m_Plugins[a_Plugin->GetDirectory()] = a_Plugin; + if (a_Plugin->Initialize()) { // Initialization OK |