Biome lists can have ":count" in them for adjusting biome occurence rate. Some more error logging.

Idea created at FS #274, http://www.mc-server.org/support/index.php?do=details&task_id=274

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1054 0a769ca7-a7f5-676a-18bf-c427514a06d6
master
madmaxoft@gmail.com 2012-11-20 19:45:28 +00:00
parent 65bc09f8e8
commit 07097534a3
2 changed files with 25 additions and 2 deletions

View File

@ -125,11 +125,33 @@ void cBiomeGenList::InitializeBiomes(const AString & a_Biomes)
// Convert each string in the list into biome:
for (AStringVector::const_iterator itr = Split.begin(); itr != Split.end(); ++itr)
{
EMCSBiome Biome = StringToBiome(*itr);
AStringVector Split2 = StringSplit(*itr, ":");
if (Split2.size() < 1)
{
continue;
}
int Count = 1;
if (Split2.size() >= 2)
{
Count = atol(Split2[1].c_str());
if (Count <= 0)
{
LOGWARNING("Cannot decode biome count: \"%s\"; using 1.", Split2[1].c_str());
Count = 1;
}
}
EMCSBiome Biome = StringToBiome(Split2[0]);
if (Biome != -1)
{
for (int i = 0; i < Count; i++)
{
m_Biomes.push_back(Biome);
}
}
else
{
LOGWARNING("Cannot decode biome name: \"%s\"; skipping", Split2[0].c_str());
}
} // for itr - Split[]
if (!m_Biomes.empty())
{

View File

@ -90,6 +90,7 @@ protected:
EMCSBiomes m_Biomes;
int m_BiomesCount; // Pulled out of m_Biomes for faster access
/// Parses the INI file setting string into m_Biomes.
void InitializeBiomes(const AString & a_Biomes);
} ;