diff options
author | Mattes D <github@xoft.cz> | 2014-05-23 13:01:06 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-23 13:01:06 +0200 |
commit | a4c964c888748e7099308dc56578244112148cdd (patch) | |
tree | a81a82be4a8bc302556321b470be1c4fe852e965 /src/Generating/GridStructGen.cpp | |
parent | Fixed datatype conversion warning. (diff) | |
download | cuberite-a4c964c888748e7099308dc56578244112148cdd.tar cuberite-a4c964c888748e7099308dc56578244112148cdd.tar.gz cuberite-a4c964c888748e7099308dc56578244112148cdd.tar.bz2 cuberite-a4c964c888748e7099308dc56578244112148cdd.tar.lz cuberite-a4c964c888748e7099308dc56578244112148cdd.tar.xz cuberite-a4c964c888748e7099308dc56578244112148cdd.tar.zst cuberite-a4c964c888748e7099308dc56578244112148cdd.zip |
Diffstat (limited to 'src/Generating/GridStructGen.cpp')
-rw-r--r-- | src/Generating/GridStructGen.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp index 3bbc89054..bfa6bccb1 100644 --- a/src/Generating/GridStructGen.cpp +++ b/src/Generating/GridStructGen.cpp @@ -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 + ); + } } |