summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/SchematicFileSerializer.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-18 23:30:41 +0200
committerMattes D <github@xoft.cz>2015-06-19 16:15:59 +0200
commit8df31067d4703beb3225b7d9787385d58f893c5d (patch)
treeab6863dece3d5741b8ea1989700f29188a4f8098 /src/WorldStorage/SchematicFileSerializer.cpp
parentPrefabPiecePool: Added loading from cubeset file. (diff)
downloadcuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.gz
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.bz2
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.lz
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.xz
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.zst
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.zip
Diffstat (limited to 'src/WorldStorage/SchematicFileSerializer.cpp')
-rw-r--r--src/WorldStorage/SchematicFileSerializer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp
index 199873968..3e9ed5bef 100644
--- a/src/WorldStorage/SchematicFileSerializer.cpp
+++ b/src/WorldStorage/SchematicFileSerializer.cpp
@@ -238,27 +238,27 @@ bool cSchematicFileSerializer::LoadFromSchematicNBT(cBlockArea & a_BlockArea, cP
}
// Copy the block types and metas:
- size_t NumBytes = a_BlockArea.GetBlockCount();
- if (a_NBT.GetDataLength(TBlockTypes) < NumBytes)
+ size_t NumTypeBytes = a_BlockArea.GetBlockCount();
+ if (a_NBT.GetDataLength(TBlockTypes) < NumTypeBytes)
{
- LOG("BlockTypes truncated in the schematic file (exp %d, got %d bytes). Loading partial.",
- (int)NumBytes, (int)a_NBT.GetDataLength(TBlockTypes)
+ LOG("BlockTypes truncated in the schematic file (exp %u, got %u bytes). Loading partial.",
+ static_cast<unsigned>(NumTypeBytes), static_cast<unsigned>(a_NBT.GetDataLength(TBlockTypes))
);
- NumBytes = a_NBT.GetDataLength(TBlockTypes);
+ NumTypeBytes = a_NBT.GetDataLength(TBlockTypes);
}
- memcpy(a_BlockArea.m_BlockTypes, a_NBT.GetData(TBlockTypes), NumBytes);
+ memcpy(a_BlockArea.m_BlockTypes, a_NBT.GetData(TBlockTypes), NumTypeBytes);
if (AreMetasPresent)
{
- size_t NumBytes = a_BlockArea.GetBlockCount();
- if (a_NBT.GetDataLength(TBlockMetas) < NumBytes)
+ size_t NumMetaBytes = a_BlockArea.GetBlockCount();
+ if (a_NBT.GetDataLength(TBlockMetas) < NumMetaBytes)
{
- LOG("BlockMetas truncated in the schematic file (exp %d, got %d bytes). Loading partial.",
- (int)NumBytes, (int)a_NBT.GetDataLength(TBlockMetas)
+ LOG("BlockMetas truncated in the schematic file (exp %u, got %u bytes). Loading partial.",
+ static_cast<unsigned>(NumMetaBytes), static_cast<unsigned>(a_NBT.GetDataLength(TBlockMetas))
);
- NumBytes = a_NBT.GetDataLength(TBlockMetas);
+ NumMetaBytes = a_NBT.GetDataLength(TBlockMetas);
}
- memcpy(a_BlockArea.m_BlockMetas, a_NBT.GetData(TBlockMetas), NumBytes);
+ memcpy(a_BlockArea.m_BlockMetas, a_NBT.GetData(TBlockMetas), NumMetaBytes);
}
return true;