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/Entities/Pawn.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/Entities/Pawn.cpp')
-rw-r--r-- | src/Entities/Pawn.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index 2986799b7..41a5b33ff 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -3,6 +3,7 @@ #include "Pawn.h" #include "../World.h" +#include "../Bindings/PluginManager.h" @@ -72,6 +73,14 @@ void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_EffectDurat void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect) { + // Check if the plugins allow the addition: + if (cPluginManager::Get()->CallHookEntityAddEffect(*this, a_EffectType, a_Effect.GetDuration(), a_Effect.GetIntensity(), a_Effect.GetUser(), a_Effect.GetDistanceModifier())) + { + // A plugin disallows the addition, bail out. + return; + } + + // No need to add empty effects: if (a_EffectType == cEntityEffect::effNoEffect) { return; |