1
0

Fixed a few compile-time and runtime warnings in ScoreboardSerializer.

This commit is contained in:
madmaxoft 2014-01-24 09:58:40 +01:00
parent b02940209d
commit 0369c585fb

View File

@ -31,16 +31,12 @@ cScoreboardSerializer::cScoreboardSerializer(const AString & a_WorldName, cScore
bool cScoreboardSerializer::Load(void)
{
cFile File;
if (!File.Open(FILE_IO_PREFIX + m_Path, cFile::fmRead))
AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path);
if (Data.empty())
{
return false;
}
AString Data;
File.ReadRestOfFile(Data);
File.Close();
AString Uncompressed;
int res = UncompressStringGZIP(Data.data(), Data.size(), Uncompressed);
@ -313,13 +309,13 @@ bool cScoreboardSerializer::LoadScoreboardFromNBT(const cParsedNBT & a_NBT)
CurrLine = a_NBT.FindChildByName(Child, "AllowFriendlyFire");
if (CurrLine >= 0)
{
AllowsFriendlyFire = a_NBT.GetInt(CurrLine);
AllowsFriendlyFire = (a_NBT.GetInt(CurrLine) != 0);
}
CurrLine = a_NBT.FindChildByName(Child, "SeeFriendlyInvisibles");
if (CurrLine >= 0)
{
CanSeeFriendlyInvisible = a_NBT.GetInt(CurrLine);
CanSeeFriendlyInvisible = (a_NBT.GetInt(CurrLine) != 0);
}
cTeam * Team = m_ScoreBoard->RegisterTeam(Name, DisplayName, Prefix, Suffix);