1
0

Made the minimum vine level configurable

This commit is contained in:
STRWarrior 2015-02-28 22:40:13 +01:00
parent 19d7ec51a0
commit 0394acfc0c
3 changed files with 7 additions and 4 deletions

View File

@ -618,7 +618,8 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
}
else if (NoCaseCompare(*itr, "Vines") == 0)
{
m_FinishGens.push_back(cFinishGenPtr(new cFinishGenVines(Seed)));
int Level = a_IniFile.GetValueSetI("Generator", "VinesLevel", 40);
m_FinishGens.push_back(cFinishGenPtr(new cFinishGenVines(Seed, Level)));
}
else if (NoCaseCompare(*itr, "WaterLakes") == 0)
{

View File

@ -287,7 +287,7 @@ void cFinishGenVines::GenFinish(cChunkDesc & a_ChunkDesc)
}
int Height = a_ChunkDesc.GetHeight(x, z);
for (int y = Height; y > 40; y--)
for (int y = Height; y > m_Level; y--)
{
if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
{

View File

@ -122,8 +122,9 @@ class cFinishGenVines :
public cFinishGen
{
public:
cFinishGenVines(int a_Seed) :
m_Noise(a_Seed)
cFinishGenVines(int a_Seed, int a_Level) :
m_Noise(a_Seed),
m_Level(a_Level)
{
}
@ -131,6 +132,7 @@ public:
protected:
cNoise m_Noise;
int m_Level;
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
};