From 013ae71c871c81437a1bad197e0bf7481d02b4a6 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 28 Feb 2012 12:11:14 +0000 Subject: Chunk now has an indicator of load failure; Chunk generator uses cChunkStay git-svn-id: http://mc-server.googlecode.com/svn/trunk@337 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorldGenerator.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/cWorldGenerator.cpp') 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++) { -- cgit v1.2.3