1
0

Sugarcane and cactus max height can be set in world.ini.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@585 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-06-09 13:00:14 +00:00
parent 2c241bb9a4
commit 8189487258
5 changed files with 77 additions and 8 deletions

View File

@@ -837,8 +837,8 @@ void cChunk::GrowSugarcane(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
--Bottom;
}
// Grow by at most a_NumBlocks, but no more than height 3:
int ToGrow = std::min(a_NumBlocks, 4 - (Top - Bottom));
// Grow by at most a_NumBlocks, but no more than max height:
int ToGrow = std::min(a_NumBlocks, m_World->GetMaxSugarcaneHeight() + 1 - (Top - Bottom));
for (int i = 0; i < ToGrow; i++)
{
BLOCKTYPE BlockType;
@@ -878,8 +878,8 @@ void cChunk::GrowCactus(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
--Bottom;
}
// Grow by at most a_NumBlocks, but no more than height 3:
int ToGrow = std::min(a_NumBlocks, 4 - (Top - Bottom));
// Grow by at most a_NumBlocks, but no more than max height:
int ToGrow = std::min(a_NumBlocks, m_World->GetMaxCactusHeight() + 1 - (Top - Bottom));
for (int i = 0; i < ToGrow; i++)
{
BLOCKTYPE BlockType;