summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/ScoreboardSerializer.cpp
diff options
context:
space:
mode:
authorMasy98 <masy@antheruscraft.de>2014-09-06 22:03:35 +0200
committerMasy98 <masy@antheruscraft.de>2014-09-06 22:03:35 +0200
commit029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e (patch)
treedd6dce68bf9f1951f6aa663ebc7b4ff3cec38172 /src/WorldStorage/ScoreboardSerializer.cpp
parentMerge remote-tracking branch 'upstream/master' (diff)
parentMerge pull request #1385 from mc-server/clangWarnings (diff)
downloadcuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.tar
cuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.tar.gz
cuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.tar.bz2
cuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.tar.lz
cuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.tar.xz
cuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.tar.zst
cuberite-029eb3d4fac9d480ab2f4bac4ac8fd981a378d9e.zip
Diffstat (limited to 'src/WorldStorage/ScoreboardSerializer.cpp')
-rw-r--r--src/WorldStorage/ScoreboardSerializer.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/WorldStorage/ScoreboardSerializer.cpp b/src/WorldStorage/ScoreboardSerializer.cpp
index da8236e0d..e30eecf67 100644
--- a/src/WorldStorage/ScoreboardSerializer.cpp
+++ b/src/WorldStorage/ScoreboardSerializer.cpp
@@ -283,37 +283,37 @@ bool cScoreboardSerializer::LoadScoreboardFromNBT(const cParsedNBT & a_NBT)
bool AllowsFriendlyFire = true, CanSeeFriendlyInvisible = false;
int CurrLine = a_NBT.FindChildByName(Child, "Name");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_String))
{
- Name = a_NBT.GetInt(CurrLine);
+ Name = a_NBT.GetString(CurrLine);
}
CurrLine = a_NBT.FindChildByName(Child, "DisplayName");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_String))
{
- DisplayName = a_NBT.GetInt(CurrLine);
+ DisplayName = a_NBT.GetString(CurrLine);
}
CurrLine = a_NBT.FindChildByName(Child, "Prefix");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_String))
{
- Prefix = a_NBT.GetInt(CurrLine);
+ Prefix = a_NBT.GetString(CurrLine);
}
CurrLine = a_NBT.FindChildByName(Child, "Suffix");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_String))
{
- Suffix = a_NBT.GetInt(CurrLine);
+ Suffix = a_NBT.GetString(CurrLine);
}
CurrLine = a_NBT.FindChildByName(Child, "AllowFriendlyFire");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Int))
{
AllowsFriendlyFire = (a_NBT.GetInt(CurrLine) != 0);
}
CurrLine = a_NBT.FindChildByName(Child, "SeeFriendlyInvisibles");
- if (CurrLine >= 0)
+ if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Int))
{
CanSeeFriendlyInvisible = (a_NBT.GetInt(CurrLine) != 0);
}