diff options
author | Mattes D <github@xoft.cz> | 2014-09-05 23:26:00 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-05 23:26:00 +0200 |
commit | 103fa8812d6bb0fcd996d1d75817d657a0a2691c (patch) | |
tree | fe9d19cbdc2409520a86ee25743253fa6b392d1d /src/WorldStorage/WorldStorage.cpp | |
parent | Fixed loading empty chunks. (diff) | |
download | cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.tar cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.tar.gz cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.tar.bz2 cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.tar.lz cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.tar.xz cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.tar.zst cuberite-103fa8812d6bb0fcd996d1d75817d657a0a2691c.zip |
Diffstat (limited to 'src/WorldStorage/WorldStorage.cpp')
-rw-r--r-- | src/WorldStorage/WorldStorage.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp index 899b0beb3..179cf9393 100644 --- a/src/WorldStorage/WorldStorage.cpp +++ b/src/WorldStorage/WorldStorage.cpp @@ -141,11 +141,11 @@ size_t cWorldStorage::GetSaveQueueLength(void) -void cWorldStorage::QueueLoadChunk(int a_ChunkX, int a_ChunkZ, bool a_Generate) +void cWorldStorage::QueueLoadChunk(int a_ChunkX, int a_ChunkZ) { ASSERT(m_World->IsChunkQueued(a_ChunkX, a_ChunkZ)); - m_LoadQueue.EnqueueItem(sChunkLoad(a_ChunkX, a_ChunkZ, a_Generate)); + m_LoadQueue.EnqueueItem(cChunkCoords(a_ChunkX, a_ChunkZ)); m_Event.Set(); } @@ -167,7 +167,7 @@ void cWorldStorage::QueueSaveChunk(int a_ChunkX, int a_ChunkZ) void cWorldStorage::UnqueueLoad(int a_ChunkX, int a_ChunkZ) { - m_LoadQueue.Remove(sChunkLoad(a_ChunkX, a_ChunkZ, true)); + m_LoadQueue.Remove(cChunkCoords(a_ChunkX, a_ChunkZ)); } @@ -246,23 +246,14 @@ void cWorldStorage::Execute(void) bool cWorldStorage::LoadOneChunk(void) { - sChunkLoad ToLoad(0, 0, false); + cChunkCoords ToLoad(0, 0); bool ShouldLoad = m_LoadQueue.TryDequeueItem(ToLoad); - if (ShouldLoad && !LoadChunk(ToLoad.m_ChunkX, ToLoad.m_ChunkZ)) + if (ShouldLoad) { - if (ToLoad.m_Generate) - { - // The chunk couldn't be loaded, generate it: - m_World->GetGenerator().QueueGenerateChunk(ToLoad.m_ChunkX, ToLoad.m_ChunkZ, false); - } - else - { - // TODO: Notify the world that the load has failed: - // m_World->ChunkLoadFailed(ToLoad.m_ChunkX, ToLoad.m_ChunkZ); - } + return LoadChunk(ToLoad.m_ChunkX, ToLoad.m_ChunkZ); } - return ShouldLoad; + return false; } |