summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-27 22:09:30 +0200
committermadmaxoft <github@xoft.cz>2014-05-27 22:09:30 +0200
commitdff71823d40690b676a617025c5fb70b7eeaf209 (patch)
treeeda6ddf26d9e24b634a5940b3d2a0fbb72148ffb /src/Generating
parentAdded AlchemistVillage prefabs (Thanks, KingsCraftAu). (diff)
parentStuff. (diff)
downloadcuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.gz
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.bz2
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.lz
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.xz
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.zst
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/GridStructGen.cpp9
-rw-r--r--src/Generating/MineShafts.cpp2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp
index 23946e2e9..474242557 100644
--- a/src/Generating/GridStructGen.cpp
+++ b/src/Generating/GridStructGen.cpp
@@ -50,6 +50,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
+ );
+ }
}
diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp
index 391e4c04f..81ae6481d 100644
--- a/src/Generating/MineShafts.cpp
+++ b/src/Generating/MineShafts.cpp
@@ -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),