summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-18 20:02:53 +0200
committermadmaxoft <github@xoft.cz>2013-10-18 20:02:53 +0200
commitca538d5323bbd8b33d87ad8ee8954529e0cf7c61 (patch)
treece53e154ea9fe4889f6b8593811a718574507d23 /source/World.cpp
parentStringToItem() recognizes "ItemName:Dmg" strings. (diff)
downloadcuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.gz
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.bz2
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.lz
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.xz
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.tar.zst
cuberite-ca538d5323bbd8b33d87ad8ee8954529e0cf7c61.zip
Diffstat (limited to '')
-rw-r--r--source/World.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/World.cpp b/source/World.cpp
index 967cd8f59..039e192d9 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -732,21 +732,19 @@ void cWorld::TickMobs(float a_Dt)
{
cMobCensus::tMobSpawnRate::const_iterator spawnrate = cMobCensus::m_SpawnRate().find(*itr);
// hostile mobs are spawned more often
- if (spawnrate != cMobCensus::m_SpawnRate().end() && m_LastSpawnMonster[*itr] < m_WorldAge - spawnrate->second)
+ if ((spawnrate != cMobCensus::m_SpawnRate().end()) && (m_LastSpawnMonster[*itr] < m_WorldAge - spawnrate->second))
{
m_LastSpawnMonster[*itr] = m_WorldAge;
// each megatype of mob has it's own cap
- if (!(MobCensus.isCaped(*itr)))
+ if (!(MobCensus.IsCapped(*itr)))
{
if (m_bAnimals)
{
-
cMobSpawner Spawner(*itr,m_AllowedMobs);
if (Spawner.CanSpawnSomething())
{
m_ChunkMap->SpawnMobs(Spawner);
// do the spawn
-
for(cMobSpawner::tSpawnedContainer::const_iterator itr2 = Spawner.getSpawned().begin(); itr2 != Spawner.getSpawned().end(); itr2++)
{
SpawnMobFinalize(*itr2);
@@ -758,14 +756,14 @@ void cWorld::TickMobs(float a_Dt)
}
// move close mobs
- cMobProximityCounter::sIterablePair allCloseEnoughToMoveMobs = MobCensus.getProximityCounter().getMobWithinThosesDistances(-1,64*16);// MG TODO : deal with this magic number (the 16 is the size of a block)
+ cMobProximityCounter::sIterablePair allCloseEnoughToMoveMobs = MobCensus.GetProximityCounter().getMobWithinThosesDistances(-1, 64 * 16);// MG TODO : deal with this magic number (the 16 is the size of a block)
for(cMobProximityCounter::tDistanceToMonster::const_iterator itr = allCloseEnoughToMoveMobs.m_Begin; itr != allCloseEnoughToMoveMobs.m_End; itr++)
{
- itr->second.m_Monster.Tick(a_Dt,itr->second.m_Chunk);
+ itr->second.m_Monster.Tick(a_Dt, itr->second.m_Chunk);
}
// remove too far mobs
- cMobProximityCounter::sIterablePair allTooFarMobs = MobCensus.getProximityCounter().getMobWithinThosesDistances(128*16,-1);// MG TODO : deal with this magic number (the 16 is the size of a block)
+ cMobProximityCounter::sIterablePair allTooFarMobs = MobCensus.GetProximityCounter().getMobWithinThosesDistances(128 * 16, -1);// MG TODO : deal with this magic number (the 16 is the size of a block)
for(cMobProximityCounter::tDistanceToMonster::const_iterator itr = allTooFarMobs.m_Begin; itr != allTooFarMobs.m_End; itr++)
{
itr->second.m_Monster.Destroy(true);