diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-28 13:11:14 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-28 13:11:14 +0100 |
commit | 013ae71c871c81437a1bad197e0bf7481d02b4a6 (patch) | |
tree | 13191934b88edd6d8ecaab43c82425c5dd719264 /source/cWorldGenerator.cpp | |
parent | Implemented synchronous chunk loading; optimized cChunkStay interface for speed (though still unused ;) (diff) | |
download | cuberite-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 'source/cWorldGenerator.cpp')
-rw-r--r-- | source/cWorldGenerator.cpp | 15 |
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++)
{
|