diff options
author | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-22 14:19:27 +0100 |
---|---|---|
committer | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-22 14:19:27 +0100 |
commit | 94ca07cfbfe0016d70963c055c87fe14f8622a4d (patch) | |
tree | 28dc91dc948287f802d9628a2ea715e1d4e0be49 /src/Mobs/SnowGolem.cpp | |
parent | Chunk is now warnings clean (diff) | |
parent | Update GETTING-STARTED.md (diff) | |
download | cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.gz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.bz2 cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.lz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.xz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.zst cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.zip |
Diffstat (limited to 'src/Mobs/SnowGolem.cpp')
-rw-r--r-- | src/Mobs/SnowGolem.cpp | 19 |
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); + } + } +} |