diff options
author | madmaxoft <github@xoft.cz> | 2014-06-13 12:47:01 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-06-17 20:39:22 +0200 |
commit | fa1d85feca6beee9e07cf92f015a883a190c726a (patch) | |
tree | ebbd3fad6e4de32e892277edce26d5e5a9c7192e /src/Bindings/PluginManager.cpp | |
parent | Entity Effects: Clarified user, added it to AddEntityEffect (diff) | |
download | cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.tar cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.tar.gz cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.tar.bz2 cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.tar.lz cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.tar.xz cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.tar.zst cuberite-fa1d85feca6beee9e07cf92f015a883a190c726a.zip |
Diffstat (limited to 'src/Bindings/PluginManager.cpp')
-rw-r--r-- | src/Bindings/PluginManager.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 9bcd8e3b7..d332980bd 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -448,6 +448,27 @@ bool cPluginManager::CallHookDisconnect(cClientHandle & a_Client, const AString +bool cPluginManager::CallHookEntityAddEffect(cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, cEntity * a_Originator, double a_DistanceModifier) +{ + HookMap::iterator Plugins = m_Hooks.find(HOOK_ENTITY_ADD_EFFECT); + if (Plugins == m_Hooks.end()) + { + return false; + } + for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) + { + if ((*itr)->OnEntityAddEffect(a_Entity, a_EffectType, a_EffectDurationTicks, a_EffectIntensity, a_Originator, a_DistanceModifier)) + { + return true; + } + } + return false; +} + + + + + bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split) { FIND_HOOK(HOOK_EXECUTE_COMMAND); |