summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-09-04 01:12:43 +0200
committerarchshift <admin@archshift.com>2014-09-04 01:12:43 +0200
commit472efa8174626a00ffdf5b39e1a44ac419cd3698 (patch)
treebd4a6bf77cf92aaa2529ead260cda91455e9ad09 /src/Mobs
parentChunkGenerator: Log world seed when creating a new one. (diff)
downloadcuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.tar
cuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.tar.gz
cuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.tar.bz2
cuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.tar.lz
cuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.tar.xz
cuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.tar.zst
cuberite-472efa8174626a00ffdf5b39e1a44ac419cd3698.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/SnowGolem.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Mobs/SnowGolem.cpp b/src/Mobs/SnowGolem.cpp
index 76334d970..43ce16ee4 100644
--- a/src/Mobs/SnowGolem.cpp
+++ b/src/Mobs/SnowGolem.cpp
@@ -30,17 +30,19 @@ 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(m_World->GetBiomeAt((int) floor(GetPosX()), (int) floor(GetPosZ()))))
+ if (IsBiomeNoDownfall(m_World->GetBiomeAt(POSX_TOINT, POSZ_TOINT)))
{
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 && cBlockInfo::IsSolid(BlockBelow))
+ BLOCKTYPE BlockBelow = m_World->GetBlock(POSX_TOINT, POSY_TOINT - 1, POSZ_TOINT);
+ BLOCKTYPE Block = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT);
+ if (Block == E_BLOCK_AIR
+ && cBlockInfo::IsSolid(BlockBelow)
+ && GetPosY() >= 64) // Must be at at least 64Y for snow to form
{
- m_World->SetBlock((int) floor(GetPosX()), (int) floor(GetPosY()), (int) floor(GetPosZ()), E_BLOCK_SNOW, 0);
+ m_World->SetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT, E_BLOCK_SNOW, 0);
}
}
}