1
0
Fork 0

Merge pull request #1022 from mc-server/FixMineshafts

Fix mineshafts
This commit is contained in:
Mattes D 2014-05-23 14:00:41 +02:00
commit 4f2db03851
2 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,15 @@ cGridStructGen::cGridStructGen(
m_MaxStructureSizeZ(a_MaxStructureSizeZ),
m_MaxCacheSize(a_MaxCacheSize)
{
size_t NumStructuresPerQuery = (size_t)((m_MaxStructureSizeX / m_GridSizeX + 1) * (m_MaxStructureSizeZ / m_GridSizeZ + 1));
if (NumStructuresPerQuery > m_MaxCacheSize)
{
m_MaxCacheSize = NumStructuresPerQuery * 4;
LOGINFO(
"cGridStructGen: The cache size is too small (%u), increasing the cache size to %u to avoid inefficiency.",
(unsigned)a_MaxCacheSize, (unsigned)m_MaxCacheSize
);
}
}

View File

@ -1283,7 +1283,7 @@ cStructGenMineShafts::cStructGenMineShafts(
int a_Seed, int a_GridSize, int a_MaxSystemSize,
int a_ChanceCorridor, int a_ChanceCrossing, int a_ChanceStaircase
) :
super(a_Seed, a_GridSize, a_GridSize, 120 + a_MaxSystemSize * 10, 120 + a_MaxSystemSize * 10, 100),
super(a_Seed, a_GridSize, a_GridSize, a_MaxSystemSize, a_MaxSystemSize, 100),
m_Noise(a_Seed),
m_GridSize(a_GridSize),
m_MaxSystemSize(a_MaxSystemSize),