summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/MapSerializer.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 19:40:00 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 19:40:00 +0200
commitd1814d2d67cdaa4fbcbd10a1af290412c29441af (patch)
treeeb132621bef87b82311f70ead69694c4c88690c9 /src/WorldStorage/MapSerializer.cpp
parente.t.c. -> etc. (diff)
parentMerge pull request #1461 from mc-server/RedstoneFix (diff)
downloadcuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.gz
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.bz2
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.lz
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.xz
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.tar.zst
cuberite-d1814d2d67cdaa4fbcbd10a1af290412c29441af.zip
Diffstat (limited to 'src/WorldStorage/MapSerializer.cpp')
-rw-r--r--src/WorldStorage/MapSerializer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp
index 012fc52f3..4a913c81a 100644
--- a/src/WorldStorage/MapSerializer.cpp
+++ b/src/WorldStorage/MapSerializer.cpp
@@ -130,14 +130,14 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
}
int CurrLine = a_NBT.FindChildByName(Data, "scale");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Byte))
{
- unsigned int Scale = a_NBT.GetByte(CurrLine);
+ unsigned int Scale = (unsigned int)a_NBT.GetByte(CurrLine);
m_Map->SetScale(Scale);
}
CurrLine = a_NBT.FindChildByName(Data, "dimension");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Byte))
{
eDimension Dimension = (eDimension) a_NBT.GetByte(CurrLine);
@@ -149,9 +149,9 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
}
CurrLine = a_NBT.FindChildByName(Data, "width");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Short))
{
- unsigned int Width = a_NBT.GetShort(CurrLine);
+ unsigned int Width = (unsigned int)a_NBT.GetShort(CurrLine);
if (Width != 128)
{
return false;
@@ -160,9 +160,9 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
}
CurrLine = a_NBT.FindChildByName(Data, "height");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Short))
{
- unsigned int Height = a_NBT.GetShort(CurrLine);
+ unsigned int Height = (unsigned int)a_NBT.GetShort(CurrLine);
if (Height >= 256)
{
return false;
@@ -171,14 +171,14 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
}
CurrLine = a_NBT.FindChildByName(Data, "xCenter");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Int))
{
int CenterX = a_NBT.GetInt(CurrLine);
m_Map->m_CenterX = CenterX;
}
CurrLine = a_NBT.FindChildByName(Data, "zCenter");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Int))
{
int CenterZ = a_NBT.GetInt(CurrLine);
m_Map->m_CenterZ = CenterZ;