diff options
author | archshift <admin@archshift.com> | 2014-09-04 01:22:04 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-09-04 01:23:03 +0200 |
commit | e1206568ec71c0e7017c1f764fdc146ba86ce30a (patch) | |
tree | f3e6dcfd16d1d1dc4cea4717efc30e04857a1111 /src/Mobs | |
parent | In 1.8, carrots and potatoes yield one less hunger point. (diff) | |
download | cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.tar cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.tar.gz cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.tar.bz2 cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.tar.lz cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.tar.xz cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.tar.zst cuberite-e1206568ec71c0e7017c1f764fdc146ba86ce30a.zip |
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/SnowGolem.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Mobs/SnowGolem.cpp b/src/Mobs/SnowGolem.cpp index 43ce16ee4..76334d970 100644 --- a/src/Mobs/SnowGolem.cpp +++ b/src/Mobs/SnowGolem.cpp @@ -30,19 +30,17 @@ 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(POSX_TOINT, POSZ_TOINT))) + if (IsBiomeNoDownfall(m_World->GetBiomeAt((int) floor(GetPosX()), (int) floor(GetPosZ())))) { TakeDamage(*this); } else { - 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 + 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)) { - m_World->SetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT, E_BLOCK_SNOW, 0); + m_World->SetBlock((int) floor(GetPosX()), (int) floor(GetPosY()), (int) floor(GetPosZ()), E_BLOCK_SNOW, 0); } } } |