summaryrefslogtreecommitdiffstats
path: root/source/Mobs/Creeper.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-13 18:26:45 +0200
committermadmaxoft <github@xoft.cz>2013-10-13 18:26:45 +0200
commite62cac07c0d74ded6109b9221045d65223b05c23 (patch)
treea1011589b593aa387a434501b40fb99de0d0a502 /source/Mobs/Creeper.cpp
parentMerge pull request #226 from SamJBarney/master (diff)
parentEight round of fixes (diff)
downloadcuberite-e62cac07c0d74ded6109b9221045d65223b05c23.tar
cuberite-e62cac07c0d74ded6109b9221045d65223b05c23.tar.gz
cuberite-e62cac07c0d74ded6109b9221045d65223b05c23.tar.bz2
cuberite-e62cac07c0d74ded6109b9221045d65223b05c23.tar.lz
cuberite-e62cac07c0d74ded6109b9221045d65223b05c23.tar.xz
cuberite-e62cac07c0d74ded6109b9221045d65223b05c23.tar.zst
cuberite-e62cac07c0d74ded6109b9221045d65223b05c23.zip
Diffstat (limited to 'source/Mobs/Creeper.cpp')
-rw-r--r--source/Mobs/Creeper.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/Mobs/Creeper.cpp b/source/Mobs/Creeper.cpp
index 9b1b68b79..b41b05f42 100644
--- a/source/Mobs/Creeper.cpp
+++ b/source/Mobs/Creeper.cpp
@@ -2,13 +2,16 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Creeper.h"
+#include "../World.h"
cCreeper::cCreeper(void) :
- super("Creeper", 50, "mob.creeper.say", "mob.creeper.say", 0.6, 1.8)
+ super("Creeper", 50, "mob.creeper.say", "mob.creeper.say", 0.6, 1.8),
+ m_bIsBlowing(false),
+ m_bIsCharged(false)
{
}
@@ -26,3 +29,19 @@ void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cCreeper::DoTakeDamage(TakeDamageInfo & a_TDI)
+{
+ super::DoTakeDamage(a_TDI);
+
+ if (a_TDI.DamageType == dtLightning)
+ {
+ m_bIsCharged = true;
+ }
+
+ m_World->BroadcastEntityMetadata(*this);
+}
+
+
+
+