summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Enderman.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-09-29 08:08:14 +0200
committerMattes D <github@xoft.cz>2014-09-29 08:08:14 +0200
commita245213d8191c3b36ce5b6fdcb003b1bb7466404 (patch)
tree364dcce52b54b93feaf6bbe308d9d780548e4137 /src/Mobs/Enderman.cpp
parentPlugin messages: Vanilla prefixes its payloads with VarInt lengths. (diff)
parentDerp (diff)
downloadcuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.tar
cuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.tar.gz
cuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.tar.bz2
cuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.tar.lz
cuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.tar.xz
cuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.tar.zst
cuberite-a245213d8191c3b36ce5b6fdcb003b1bb7466404.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Enderman.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index 51255beb3..567714382 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -181,3 +181,23 @@ bool cEnderman::CheckLight()
return true;
}
+
+
+
+
+
+void cEnderman::Tick(float a_Dt, cChunk & a_Chunk)
+{
+ super::Tick(a_Dt, a_Chunk);
+
+ // TODO take damage in rain
+
+ // Take damage when touching water, drowning damage seems to be most appropriate
+ if (IsSwimming())
+ {
+ EventLosePlayer();
+ TakeDamage(dtDrowning, NULL, 1, 0);
+ // TODO teleport to a safe location
+ }
+
+}