From 8180b643fff149e6411a57d0250ae54d94fcd29a Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Fri, 31 Jan 2014 21:34:00 +0400 Subject: Added reading saved state of the wolf (sitting or standing). --- src/WorldStorage/WSSAnvil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/WorldStorage/WSSAnvil.cpp') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 02396bb16..63999add3 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1886,6 +1886,12 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N Monster->SetIsTame(true); } } + int SittingIdx = a_NBT.FindChildByName(a_TagIdx, "Sitting"); + if (SittingIdx > 0) + { + bool IsSitting = (a_NBT.GetByte(SittingIdx) > 0); + Monster->SetIsSitting(IsSitting); + } a_Entities.push_back(Monster.release()); } -- cgit v1.2.3 From 0259aed8beba5a2a46d537617e122a5dacc373a3 Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Sat, 1 Feb 2014 20:16:42 +0400 Subject: Added saving of collar's color. --- src/WorldStorage/WSSAnvil.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/WorldStorage/WSSAnvil.cpp') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 63999add3..a9c6a3475 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1886,12 +1886,18 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N Monster->SetIsTame(true); } } - int SittingIdx = a_NBT.FindChildByName(a_TagIdx, "Sitting"); - if (SittingIdx > 0) + int IsSittingIdx = a_NBT.FindChildByName(a_TagIdx, "IsSitting"); + if (IsSittingIdx > 0) { - bool IsSitting = (a_NBT.GetByte(SittingIdx) > 0); + bool IsSitting = ((a_NBT.GetByte(IsSittingIdx) == 1) ? true : false); Monster->SetIsSitting(IsSitting); } + int CollarColorIdx = a_NBT.FindChildByName(a_TagIdx, "CollarColor"); + if (CollarColorIdx > 0) + { + int CollarColor = a_NBT.GetInt(CollarColorIdx); + Monster->SetCollarColor(CollarColor); + } a_Entities.push_back(Monster.release()); } -- cgit v1.2.3 From a1c36c18e0d12516cabf5045807596d5555c54a2 Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Sun, 2 Feb 2014 13:56:55 +0400 Subject: Fixed sitting tag. --- src/WorldStorage/WSSAnvil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/WorldStorage/WSSAnvil.cpp') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index a9c6a3475..ad15a093b 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1886,11 +1886,11 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N Monster->SetIsTame(true); } } - int IsSittingIdx = a_NBT.FindChildByName(a_TagIdx, "IsSitting"); - if (IsSittingIdx > 0) + int SittingIdx = a_NBT.FindChildByName(a_TagIdx, "Sitting"); + if (SittingIdx > 0) { - bool IsSitting = ((a_NBT.GetByte(IsSittingIdx) == 1) ? true : false); - Monster->SetIsSitting(IsSitting); + bool Sitting = ((a_NBT.GetByte(SittingIdx) == 1) ? true : false); + Monster->SetIsSitting(Sitting); } int CollarColorIdx = a_NBT.FindChildByName(a_TagIdx, "CollarColor"); if (CollarColorIdx > 0) -- cgit v1.2.3 From a134fd45cfd4314d0f51cd402ffd1ec01c5736b9 Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Sun, 2 Feb 2014 14:28:42 +0400 Subject: Added saving of angry flag. --- src/WorldStorage/WSSAnvil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/WorldStorage/WSSAnvil.cpp') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index ad15a093b..d72165c46 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1892,6 +1892,12 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N bool Sitting = ((a_NBT.GetByte(SittingIdx) == 1) ? true : false); Monster->SetIsSitting(Sitting); } + int AngryIdx = a_NBT.FindChildByName(a_TagIdx, "Angry"); + if (AngryIdx > 0) + { + bool Angry = ((a_NBT.GetByte(AngryIdx) == 1) ? true : false); + Monster->SetIsAngry(Angry); + } int CollarColorIdx = a_NBT.FindChildByName(a_TagIdx, "CollarColor"); if (CollarColorIdx > 0) { -- cgit v1.2.3