summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-04 12:11:38 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-04 12:11:38 +0200
commit7bd414e9edf432641c30448c3fc0ff04d91ad3ab (patch)
tree93cb320e9911343f052b722278231c8b9dd79a1a /src/WorldStorage/NBTChunkSerializer.cpp
parentChanged /** to /* (diff)
parentMerge pull request #1285 from mc-server/StrCaseRefactor (diff)
downloadcuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.tar
cuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.tar.gz
cuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.tar.bz2
cuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.tar.lz
cuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.tar.xz
cuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.tar.zst
cuberite-7bd414e9edf432641c30448c3fc0ff04d91ad3ab.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index ecda9b8fd..e435a1b1f 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -570,8 +570,14 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
case cMonster::mtWolf:
{
const cWolf & Wolf = *((cWolf *)a_Monster);
- m_Writer.AddString("Owner", Wolf.GetOwnerName());
- m_Writer.AddString("OwnerUUID", Wolf.GetOwnerUUID());
+ if (!Wolf.GetOwnerName().empty())
+ {
+ m_Writer.AddString("Owner", Wolf.GetOwnerName());
+ }
+ if (!Wolf.GetOwnerUUID().empty())
+ {
+ m_Writer.AddString("OwnerUUID", Wolf.GetOwnerUUID());
+ }
m_Writer.AddByte("Sitting", Wolf.IsSitting() ? 1 : 0);
m_Writer.AddByte("Angry", Wolf.IsAngry() ? 1 : 0);
m_Writer.AddInt("CollarColor", Wolf.GetCollarColor());