summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/MobSpawnerEntity.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-12-01 14:58:13 +0100
committerHowaner <franzi.moos@googlemail.com>2014-12-01 14:58:13 +0100
commitbcbd73f7d80b0a64b87c30840048f99613308ce0 (patch)
tree5a2c61db0c715774fbc8a55918cdcd57c405c1aa /src/BlockEntities/MobSpawnerEntity.cpp
parentMerge branch 'master' into MobSpawner (diff)
downloadcuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.tar
cuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.tar.gz
cuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.tar.bz2
cuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.tar.lz
cuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.tar.xz
cuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.tar.zst
cuberite-bcbd73f7d80b0a64b87c30840048f99613308ce0.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/MobSpawnerEntity.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp
index 26499972d..5edee888a 100644
--- a/src/BlockEntities/MobSpawnerEntity.cpp
+++ b/src/BlockEntities/MobSpawnerEntity.cpp
@@ -104,7 +104,7 @@ bool cMobSpawnerEntity::Tick(float a_Dt, cChunk & a_Chunk)
void cMobSpawnerEntity::ResetTimer(void)
{
- m_SpawnDelay = (short) (200 + m_World->GetTickRandomNumber(600));
+ m_SpawnDelay = static_cast<short>(200 + m_World->GetTickRandomNumber(600));
m_World->BroadcastBlockEntity(m_PosX, m_PosY, m_PosZ);
}
@@ -266,7 +266,7 @@ int cMobSpawnerEntity::GetNearbyMonsterNum(eMonsterType a_EntityType)
return;
}
- if (((m_SpawnerPos - a_Entity->GetPosition()).Length() <= 8) && (Diff(m_SpawnerPos.y, a_Entity->GetPosY()) <= 4.0))
+ if ((Diff(m_SpawnerPos.x, a_Entity->GetPosX()) <= 8.0) && (Diff(m_SpawnerPos.y, a_Entity->GetPosY()) <= 4.0) && (Diff(m_SpawnerPos.z, a_Entity->GetPosZ()) <= 8.0))
{
m_NumEntities++;
}