summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
authormgueydan <gueydan.mathieuÃ@gmail.com>2013-09-08 03:30:09 +0200
committermgueydan <gueydan.mathieuÃ@gmail.com>2013-09-08 03:30:09 +0200
commitd67e8dcca5dda496480f3e983a0cf72c1d047bf7 (patch)
treec7808551cb07152cb82d37774187450193baab7f /source/World.cpp
parentAdding glue to call everything done in last commits - now the mobs are spawning (diff)
downloadcuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.tar
cuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.tar.gz
cuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.tar.bz2
cuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.tar.lz
cuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.tar.xz
cuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.tar.zst
cuberite-d67e8dcca5dda496480f3e983a0cf72c1d047bf7.zip
Diffstat (limited to '')
-rw-r--r--source/World.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/World.cpp b/source/World.cpp
index 2e8f30840..9ca432f50 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -491,14 +491,19 @@ void cWorld::Start(void)
m_GameMode = (eGameMode)IniFile.GetValueSetI("GameMode", "GameMode", m_GameMode);
- m_bAnimals = true;
-
- m_AllowedMobs.insert(cMonster::mtCow); // MG TODO : temporary
- m_AllowedMobs.insert(cMonster::mtZombie);
- m_AllowedMobs.insert(cMonster::mtZombiePigman);
- m_AllowedMobs.insert(cMonster::mtBat);
- m_AllowedMobs.insert(cMonster::mtSpider);
- m_AllowedMobs.insert(cMonster::mtGhast);
+ m_bAnimals = IniFile.GetValueB("Monsters", "AnimalsOn", true);
+ AString sAllMonsters = IniFile.GetValue("Monsters", "Types");
+ AStringVector SplitList = StringSplit(sAllMonsters, ",");
+ for (unsigned int i = 0; i < SplitList.size(); ++i)
+ {
+ cMonster::eType ToAdd = cMobTypesManager::fromStringToMobType(SplitList[i]);
+ if (ToAdd != cMonster::mtInvalidType)
+ {
+ m_AllowedMobs.insert(ToAdd);
+ LOGD("Allowed mob: %s",cMobTypesManager::fromMobTypeToString(ToAdd).c_str()); // a bit reverse working, but very few ressources wasted
+ }
+ };
+
m_ChunkMap = new cChunkMap(this);