summaryrefslogtreecommitdiffstats
path: root/src/Entities/EntityEffect.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-01 19:51:43 +0200
committerLukas Pioch <lukas@zgow.de>2017-08-03 15:34:38 +0200
commit79eb4c3aed59edce58d2529bf9c6334f7fe6fbad (patch)
tree1c572f4c9939968abbcb3ec6b9d6d9630b1f900a /src/Entities/EntityEffect.h
parentRemove double includes part 2 (#3890) (diff)
downloadcuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.gz
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.bz2
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.lz
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.xz
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.tar.zst
cuberite-79eb4c3aed59edce58d2529bf9c6334f7fe6fbad.zip
Diffstat (limited to 'src/Entities/EntityEffect.h')
-rw-r--r--src/Entities/EntityEffect.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Entities/EntityEffect.h b/src/Entities/EntityEffect.h
index aa18b500e..dd126c20d 100644
--- a/src/Entities/EntityEffect.h
+++ b/src/Entities/EntityEffect.h
@@ -81,7 +81,7 @@ public:
@param a_Duration How long this effect will last, in ticks
@param a_Intensity How strong the effect will be applied
@param a_DistanceModifier The distance modifier for affecting potency, defaults to 1 */
- static cEntityEffect * CreateEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier);
+ static std::unique_ptr<cEntityEffect> CreateEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier);
/** Returns how many ticks this effect has been active for */
int GetTicks(void) const { return m_Ticks; }
@@ -346,6 +346,12 @@ public:
super(a_Duration, a_Intensity, a_DistanceModifier)
{
}
+
+ virtual void OnActivate (cPawn & a_Target) override { BroadcastMetadata(a_Target); }
+ virtual void OnDeactivate(cPawn & a_Target) override { BroadcastMetadata(a_Target); }
+
+private:
+ static void BroadcastMetadata(cPawn & a_Target);
};