1
0

Anvil: Wolf owner not saved if not present.

This commit is contained in:
madmaxoft 2014-08-04 11:29:40 +02:00
parent 122344bb7a
commit 054ce9bcc4

View File

@ -570,8 +570,14 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
case cMonster::mtWolf: case cMonster::mtWolf:
{ {
const cWolf & Wolf = *((cWolf *)a_Monster); const cWolf & Wolf = *((cWolf *)a_Monster);
m_Writer.AddString("Owner", Wolf.GetOwnerName()); if (!Wolf.GetOwnerName().empty())
m_Writer.AddString("OwnerUUID", Wolf.GetOwnerUUID()); {
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("Sitting", Wolf.IsSitting() ? 1 : 0);
m_Writer.AddByte("Angry", Wolf.IsAngry() ? 1 : 0); m_Writer.AddByte("Angry", Wolf.IsAngry() ? 1 : 0);
m_Writer.AddInt("CollarColor", Wolf.GetCollarColor()); m_Writer.AddInt("CollarColor", Wolf.GetCollarColor());