From fa1d85feca6beee9e07cf92f015a883a190c726a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 13 Jun 2014 12:47:01 +0200 Subject: Added the OnEntityAddEffect hook. --- src/Entities/Pawn.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Entities/Pawn.cpp') 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; -- cgit v1.2.3