summaryrefslogtreecommitdiffstats
path: root/src/Generating/GridStructGen.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-13 17:10:57 +0200
committerMattes D <github@xoft.cz>2014-07-13 17:10:57 +0200
commit69eaa55b553af1193f44b397853468ad0e8da06b (patch)
treebe60980e3e0116bb1ef0495492cfa47823ff69fd /src/Generating/GridStructGen.cpp
parentTolua driver: Fixed wrong indentation. (diff)
parentAdded parenthasies (diff)
downloadcuberite-69eaa55b553af1193f44b397853468ad0e8da06b.tar
cuberite-69eaa55b553af1193f44b397853468ad0e8da06b.tar.gz
cuberite-69eaa55b553af1193f44b397853468ad0e8da06b.tar.bz2
cuberite-69eaa55b553af1193f44b397853468ad0e8da06b.tar.lz
cuberite-69eaa55b553af1193f44b397853468ad0e8da06b.tar.xz
cuberite-69eaa55b553af1193f44b397853468ad0e8da06b.tar.zst
cuberite-69eaa55b553af1193f44b397853468ad0e8da06b.zip
Diffstat (limited to 'src/Generating/GridStructGen.cpp')
-rw-r--r--src/Generating/GridStructGen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp
index 95f8c38bc..a3578de6f 100644
--- a/src/Generating/GridStructGen.cpp
+++ b/src/Generating/GridStructGen.cpp
@@ -53,6 +53,16 @@ cGridStructGen::cGridStructGen(
m_MaxStructureSizeZ(a_MaxStructureSizeZ),
m_MaxCacheSize(a_MaxCacheSize)
{
+ if (m_GridSizeX == 0)
+ {
+ LOG("Grid Size cannot be zero, setting to 1");
+ m_GridSizeX = 1;
+ }
+ if (m_GridSizeZ == 0)
+ {
+ LOG("Grid Size cannot be zero, setting to 1");
+ m_GridSizeZ = 1;
+ }
size_t NumStructuresPerQuery = (size_t)(((m_MaxStructureSizeX + m_MaxOffsetX) / m_GridSizeX + 1) * ((m_MaxStructureSizeZ + m_MaxOffsetZ) / m_GridSizeZ + 1));
if (NumStructuresPerQuery > m_MaxCacheSize)
{