summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-07 09:54:03 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:19 +0200
commite98ffccd80ae05d09b40d5edd407428515b14406 (patch)
tree072a8a6de986fabfe28502194e88d23d8bb7bec2 /src/Entities
parentEntityEffect: read-only getters, added user and distance modifier fields (diff)
downloadcuberite-e98ffccd80ae05d09b40d5edd407428515b14406.tar
cuberite-e98ffccd80ae05d09b40d5edd407428515b14406.tar.gz
cuberite-e98ffccd80ae05d09b40d5edd407428515b14406.tar.bz2
cuberite-e98ffccd80ae05d09b40d5edd407428515b14406.tar.lz
cuberite-e98ffccd80ae05d09b40d5edd407428515b14406.tar.xz
cuberite-e98ffccd80ae05d09b40d5edd407428515b14406.tar.zst
cuberite-e98ffccd80ae05d09b40d5edd407428515b14406.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pawn.cpp7
-rw-r--r--src/Entities/Pawn.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 1d2542d58..1f93e59fa 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -2,6 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Pawn.h"
+#include "../World.h"
@@ -20,7 +21,7 @@ cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height)
void cPawn::Tick(float a_Dt, cChunk & a_Chunk)
{
// Iterate through this entity's applied effects
- for (std::map<cEntityEffect::eType, cEntityEffect>::iterator iter = m_EntityEffects.begin();
+ for (tEffectMap::iterator iter = m_EntityEffects.begin();
iter != m_EntityEffects.end();
++iter)
{
@@ -49,7 +50,7 @@ void cPawn::Tick(float a_Dt, cChunk & a_Chunk)
void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect)
{
m_EntityEffects[a_EffectType] = a_Effect;
- //m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.m_Intensity, a_Effect.m_Ticks);
+ m_World->BroadcastEntityEffect(*this, a_EffectType, a_Effect.GetIntensity(), a_Effect.m_Ticks);
}
@@ -59,7 +60,7 @@ void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_E
void cPawn::RemoveEntityEffect(cEntityEffect::eType a_EffectType)
{
m_EntityEffects.erase(a_EffectType);
- //m_World->BroadcastRemoveEntityEffect(*this, a_EffectType);
+ m_World->BroadcastRemoveEntityEffect(*this, a_EffectType);
}
diff --git a/src/Entities/Pawn.h b/src/Entities/Pawn.h
index f7d7213ff..1a897c958 100644
--- a/src/Entities/Pawn.h
+++ b/src/Entities/Pawn.h
@@ -26,7 +26,8 @@ public:
void RemoveEntityEffect(cEntityEffect::eType a_EffectType);
protected:
- std::map<cEntityEffect::eType, cEntityEffect> m_EntityEffects;
+ typedef std::map<cEntityEffect::eType, cEntityEffect> tEffectMap;
+ tEffectMap m_EntityEffects;
virtual void HandleEntityEffects(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect);
} ; // tolua_export