summaryrefslogtreecommitdiffstats
path: root/src/MobCensus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MobCensus.cpp')
-rw-r--r--src/MobCensus.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/MobCensus.cpp b/src/MobCensus.cpp
index d6db2f9e5..c7c1e7c81 100644
--- a/src/MobCensus.cpp
+++ b/src/MobCensus.cpp
@@ -19,9 +19,10 @@ void cMobCensus::CollectMob(cMonster & a_Monster, cChunk & a_Chunk, double a_Dis
bool cMobCensus::IsCapped(cMonster::eFamily a_MobFamily)
{
- const int ratio = 319; // This should be 256 as we are only supposed to take account from chunks that are in 17 x 17 from a player
- // but for now, we use all chunks loaded by players. that means 19 x 19 chunks. That's why we use 256 * (19 * 19) / (17 * 17) = 319
- // MG TODO : code the correct count
+ const int ratio = 319; // This should be 256 as we are only supposed to take account from chunks that are in 17 x
+ // 17 from a player
+ // but for now, we use all chunks loaded by players. that means 19 x 19 chunks. That's why we use 256 * (19 * 19) /
+ // (17 * 17) = 319 MG TODO : code the correct count
const auto MobCap = ((GetCapMultiplier(a_MobFamily) * GetNumChunks()) / ratio);
return (MobCap < m_MobFamilyCollecter.GetNumberOfCollectedMobs(a_MobFamily));
}
@@ -79,13 +80,24 @@ cMobProximityCounter & cMobCensus::GetProximityCounter(void)
void cMobCensus::Logd()
{
- LOGD("Hostile mobs : %d %s", m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfHostile), IsCapped(cMonster::mfHostile) ? "(capped)" : "");
- LOGD("Ambient mobs : %d %s", m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfAmbient), IsCapped(cMonster::mfAmbient) ? "(capped)" : "");
- LOGD("Water mobs : %d %s", m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfWater), IsCapped(cMonster::mfWater) ? "(capped)" : "");
- LOGD("Passive mobs : %d %s", m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfPassive), IsCapped(cMonster::mfPassive) ? "(capped)" : "");
+ LOGD(
+ "Hostile mobs : %d %s",
+ m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfHostile),
+ IsCapped(cMonster::mfHostile) ? "(capped)" : ""
+ );
+ LOGD(
+ "Ambient mobs : %d %s",
+ m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfAmbient),
+ IsCapped(cMonster::mfAmbient) ? "(capped)" : ""
+ );
+ LOGD(
+ "Water mobs : %d %s",
+ m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfWater),
+ IsCapped(cMonster::mfWater) ? "(capped)" : ""
+ );
+ LOGD(
+ "Passive mobs : %d %s",
+ m_MobFamilyCollecter.GetNumberOfCollectedMobs(cMonster::mfPassive),
+ IsCapped(cMonster::mfPassive) ? "(capped)" : ""
+ );
}
-
-
-
-
-