summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2014-10-20 14:46:24 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2014-10-20 14:46:24 +0200
commit1a46feda43dff022d5a369fb85612b2670fe97e4 (patch)
tree6c6dcc0f1f736dde7fd8a0b8440174105bf7ba7e
parentMerge pull request #1549 from SphinxC0re/master (diff)
downloadcuberite-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.cpp12
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