summaryrefslogtreecommitdiffstats
path: root/source/cWorldGenerator.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-28 13:11:14 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-28 13:11:14 +0100
commit013ae71c871c81437a1bad197e0bf7481d02b4a6 (patch)
tree13191934b88edd6d8ecaab43c82425c5dd719264 /source/cWorldGenerator.cpp
parentImplemented synchronous chunk loading; optimized cChunkStay interface for speed (though still unused ;) (diff)
downloadcuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.tar
cuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.tar.gz
cuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.tar.bz2
cuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.tar.lz
cuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.tar.xz
cuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.tar.zst
cuberite-013ae71c871c81437a1bad197e0bf7481d02b4a6.zip
Diffstat (limited to '')
-rw-r--r--source/cWorldGenerator.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/cWorldGenerator.cpp b/source/cWorldGenerator.cpp
index 5d9f82bae..a0c670eae 100644
--- a/source/cWorldGenerator.cpp
+++ b/source/cWorldGenerator.cpp
@@ -94,6 +94,21 @@ void cWorldGenerator::GenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, ch
void cWorldGenerator::PostGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{
// Check the chunk just generated and all its 8-way neighbors
+
+ // Make the chunks stay loaded in the surrounding 5x5 area:
+ cChunkStay Stay(m_World);
+ Stay.Add(a_ChunkX, a_ChunkY, a_ChunkZ);
+ for (int x = -2; x <= 2; x++)
+ {
+ for (int z = -2; z <= 2; z++)
+ {
+ Stay.Add(a_ChunkX + x, a_ChunkY, a_ChunkZ + z);
+ } // for z
+ } // for x
+ Stay.Enable();
+
+ m_World->LoadChunks(Stay);
+
CheckNeighbors(a_ChunkX, a_ChunkY, a_ChunkZ);
for (int i = 0; i < ARRAYCOUNT(g_NeighborCoords); i++)
{