summaryrefslogtreecommitdiffstats
path: root/src/Generating/GridStructGen.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-05-08 21:10:55 +0200
committerMattes D <github@xoft.cz>2014-05-08 21:10:55 +0200
commitee680990ba12b8d272a34e45f372893f2525c868 (patch)
treec5c8ce8a5172fbc6ec6d2b5a29de94cb6ba330a8 /src/Generating/GridStructGen.cpp
parentMerge branch 'master' into GridStructGen (diff)
downloadcuberite-ee680990ba12b8d272a34e45f372893f2525c868.tar
cuberite-ee680990ba12b8d272a34e45f372893f2525c868.tar.gz
cuberite-ee680990ba12b8d272a34e45f372893f2525c868.tar.bz2
cuberite-ee680990ba12b8d272a34e45f372893f2525c868.tar.lz
cuberite-ee680990ba12b8d272a34e45f372893f2525c868.tar.xz
cuberite-ee680990ba12b8d272a34e45f372893f2525c868.tar.zst
cuberite-ee680990ba12b8d272a34e45f372893f2525c868.zip
Diffstat (limited to 'src/Generating/GridStructGen.cpp')
-rw-r--r--src/Generating/GridStructGen.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/Generating/GridStructGen.cpp b/src/Generating/GridStructGen.cpp
index 2f064d3a0..3bbc89054 100644
--- a/src/Generating/GridStructGen.cpp
+++ b/src/Generating/GridStructGen.cpp
@@ -39,29 +39,17 @@ void cGridStructGen::GetStructuresForChunk(int a_ChunkX, int a_ChunkZ, cStructur
int MinGridZ = MinBlockZ / m_GridSizeZ;
int MaxGridX = (MaxBlockX + m_GridSizeX - 1) / m_GridSizeX;
int MaxGridZ = (MaxBlockZ + m_GridSizeZ - 1) / m_GridSizeZ;
- if (MinBlockX < 0)
- {
- --MinGridX;
- }
- if (MinBlockZ < 0)
- {
- --MinGridZ;
- }
- if (MaxBlockX < 0)
- {
- --MaxGridX;
- }
- if (MaxBlockZ < 0)
- {
- --MaxGridZ;
- }
+ int MinX = MinGridX * m_GridSizeX;
+ int MaxX = MaxGridX * m_GridSizeX;
+ int MinZ = MinGridZ * m_GridSizeZ;
+ int MaxZ = MaxGridZ * m_GridSizeZ;
// Walk the cache, move each structure that we want into a_Structures:
for (cStructurePtrs::iterator itr = m_Cache.begin(), end = m_Cache.end(); itr != end;)
{
if (
- ((*itr)->m_OriginX >= MinBlockX) && ((*itr)->m_OriginX < MaxBlockX) &&
- ((*itr)->m_OriginZ >= MinBlockZ) && ((*itr)->m_OriginZ < MaxBlockZ)
+ ((*itr)->m_OriginX >= MinX) && ((*itr)->m_OriginX < MaxX) &&
+ ((*itr)->m_OriginZ >= MinZ) && ((*itr)->m_OriginZ < MaxZ)
)
{
// want