summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/EntityEffects.h1
-rw-r--r--src/Entities/Pawn.cpp14
-rw-r--r--src/Entities/Pawn.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/src/Entities/EntityEffects.h b/src/Entities/EntityEffects.h
index 2bda2e104..137eb6480 100644
--- a/src/Entities/EntityEffects.h
+++ b/src/Entities/EntityEffects.h
@@ -9,6 +9,7 @@ public:
/** All types of entity effects (numbers correspond to IDs) */
enum eType
{
+ efNoEffect = 0,
efSpeed = 1,
efSlowness = 2,
efHaste = 3,
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 4c840e6e1..5cf270006 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -52,8 +52,22 @@ void cPawn::Tick(float a_Dt, cChunk & a_Chunk)
+void cPawn::KilledBy(cEntity *a_Killer)
+{
+ ClearEntityEffects();
+}
+
+
+
+
+
void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect)
{
+ if (a_EffectType == cEntityEffect::efNoEffect)
+ {
+ return;
+ }
+
m_EntityEffects[a_EffectType] = a_Effect;
m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.GetIntensity(), a_Effect.m_Ticks);
}
diff --git a/src/Entities/Pawn.h b/src/Entities/Pawn.h
index 857488901..47fb691f4 100644
--- a/src/Entities/Pawn.h
+++ b/src/Entities/Pawn.h
@@ -21,6 +21,7 @@ public:
cPawn(eEntityType a_EntityType, double a_Width, double a_Height);
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
+ virtual void KilledBy(cEntity * a_Killer) override;
/** Applies an entity effect
* @param a_EffectType The entity effect to apply