summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 0e3cdde76..2542cd2da 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -1177,17 +1177,14 @@ public:
////////////////////////////////////////////////////////////////////////////////
// NBTChunkSerializer:
-bool NBTChunkSerializer::serialize(const cWorld & aWorld, cChunkCoords aCoords, cFastNBTWriter & aWriter)
+void NBTChunkSerializer::Serialize(const cWorld & aWorld, cChunkCoords aCoords, cFastNBTWriter & aWriter)
{
SerializerCollector serializer(aWriter);
aWriter.BeginCompound("Level");
aWriter.AddInt("xPos", aCoords.m_ChunkX);
aWriter.AddInt("zPos", aCoords.m_ChunkZ);
- if (!aWorld.GetChunkData(aCoords, serializer))
- {
- aWriter.EndCompound(); // "Level"
- return false;
- }
+ [[maybe_unused]] const bool Result = aWorld.GetChunkData(aCoords, serializer); // Chunk must be present in order to save
+ ASSERT(Result);
serializer.Finish(); // Close NBT tags
// Save biomes, both MCS (IntArray) and MC-vanilla (ByteArray):
@@ -1240,5 +1237,4 @@ bool NBTChunkSerializer::serialize(const cWorld & aWorld, cChunkCoords aCoords,
aWriter.AddByte("TerrainPopulated", 1);
aWriter.EndCompound(); // "Level"
- return true;
}