summaryrefslogtreecommitdiffstats
path: root/src/Generating/GridStructGen.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-07 22:34:06 +0200
committermadmaxoft <github@xoft.cz>2014-05-07 22:34:06 +0200
commit564261cfd9e385dfe6331c0585cae3b46989dd17 (patch)
tree33562e8da096a6f7d8ed28911a9179181d1a738b /src/Generating/GridStructGen.cpp
parentInitial cPrefabPiecePool refactoring. (diff)
downloadcuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.tar
cuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.tar.gz
cuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.tar.bz2
cuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.tar.lz
cuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.tar.xz
cuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.tar.zst
cuberite-564261cfd9e385dfe6331c0585cae3b46989dd17.zip
Diffstat (limited to 'src/Generating/GridStructGen.cpp')
-rw-r--r--src/Generating/GridStructGen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp
index 975fd3fdc..2f064d3a0 100644
--- a/src/Generating/GridStructGen.cpp
+++ b/src/Generating/GridStructGen.cpp
@@ -37,21 +37,21 @@ void cGridStructGen::GetStructuresForChunk(int a_ChunkX, int a_ChunkZ, cStructur
int MaxBlockZ = a_ChunkZ * cChunkDef::Width + m_MaxStructureSizeZ + cChunkDef::Width - 1;
int MinGridX = MinBlockX / m_GridSizeX;
int MinGridZ = MinBlockZ / m_GridSizeZ;
- int MaxGridX = MaxBlockX / m_GridSizeX;
- int MaxGridZ = MaxBlockX / m_GridSizeZ;
- if (MinGridX < 0)
+ int MaxGridX = (MaxBlockX + m_GridSizeX - 1) / m_GridSizeX;
+ int MaxGridZ = (MaxBlockZ + m_GridSizeZ - 1) / m_GridSizeZ;
+ if (MinBlockX < 0)
{
--MinGridX;
}
- if (MinGridZ < 0)
+ if (MinBlockZ < 0)
{
--MinGridZ;
}
- if (MaxGridX < 0)
+ if (MaxBlockX < 0)
{
--MaxGridX;
}
- if (MaxGridZ < 0)
+ if (MaxBlockZ < 0)
{
--MaxGridZ;
}