summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index b5a6252ff..bc88f4e7b 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -444,12 +444,18 @@ void cChunkMap::ChunkLighted(
-bool cChunkMap::GetChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataCallback & a_Callback)
+bool cChunkMap::GetChunkData(cChunkCoords a_Coords, cChunkDataCallback & a_Callback)
{
+ if (!a_Callback.Coords(a_Coords.m_ChunkX, a_Coords.m_ChunkZ))
+ {
+ // The callback doesn't want the data
+ return false;
+ }
cCSLock Lock(m_CSChunks);
- cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, a_ChunkZ);
+ cChunkPtr Chunk = GetChunkNoGen(a_Coords);
if ((Chunk == nullptr) || !Chunk->IsValid())
{
+ // The chunk is not present
return false;
}
Chunk->GetAllData(a_Callback);