summaryrefslogtreecommitdiffstats
path: root/src/Mobs/SnowGolem.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-22 16:21:34 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-22 16:21:34 +0100
commit1a9d93665f9f82ccd9054aa1c8e9c24f13776a91 (patch)
treee9572b3fdf1d47c0769a3d43d3fc4dfac68fd0dd /src/Mobs/SnowGolem.cpp
parentbasic threadsafe queue interface (diff)
parentUpdate GETTING-STARTED.md (diff)
downloadcuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.tar
cuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.tar.gz
cuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.tar.bz2
cuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.tar.lz
cuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.tar.xz
cuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.tar.zst
cuberite-1a9d93665f9f82ccd9054aa1c8e9c24f13776a91.zip
Diffstat (limited to 'src/Mobs/SnowGolem.cpp')
-rw-r--r--src/Mobs/SnowGolem.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Mobs/SnowGolem.cpp b/src/Mobs/SnowGolem.cpp
index 9e199f87e..06021cca5 100644
--- a/src/Mobs/SnowGolem.cpp
+++ b/src/Mobs/SnowGolem.cpp
@@ -2,6 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "SnowGolem.h"
+#include "../World.h"
@@ -24,3 +25,21 @@ void cSnowGolem::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cSnowGolem::Tick(float a_Dt, cChunk & a_Chunk)
+{
+ super::Tick(a_Dt, a_Chunk);
+ if (IsBiomeNoDownfall((EMCSBiome) m_World->GetBiomeAt((int) floor(GetPosX()), (int) floor(GetPosZ())) ))
+ {
+ TakeDamage(*this);
+ }
+ else
+ {
+ BLOCKTYPE BlockBelow = m_World->GetBlock((int) floor(GetPosX()), (int) floor(GetPosY()) - 1, (int) floor(GetPosZ()));
+ BLOCKTYPE Block = m_World->GetBlock((int) floor(GetPosX()), (int) floor(GetPosY()), (int) floor(GetPosZ()));
+ if (Block == E_BLOCK_AIR && g_BlockIsSolid[BlockBelow])
+ {
+ m_World->SetBlock((int) floor(GetPosX()), (int) floor(GetPosY()), (int) floor(GetPosZ()), E_BLOCK_SNOW, 0);
+ }
+ }
+}