summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-08-04 11:29:40 +0200
committermadmaxoft <github@xoft.cz>2014-08-04 11:29:40 +0200
commit054ce9bcc45018b9f024654e7d35327fbc20d119 (patch)
tree2e9ec7cadbba3e0ab18be54c41d742c100d471dd
parentRewritten string case manipulation to use std::transform. (diff)
downloadcuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.tar
cuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.tar.gz
cuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.tar.bz2
cuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.tar.lz
cuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.tar.xz
cuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.tar.zst
cuberite-054ce9bcc45018b9f024654e7d35327fbc20d119.zip
-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());