Added CustomName saving.
This commit is contained in:
@@ -2640,6 +2640,19 @@ bool cWSSAnvil::LoadMonsterBaseFromNBT(cMonster & a_Monster, const cParsedNBT &
|
||||
a_Monster.SetCanPickUpLoot(CanPickUpLoot);
|
||||
}
|
||||
|
||||
int CustomNameTag = a_NBT.FindChildByName(a_TagIdx, "CustomName");
|
||||
if ((CustomNameTag > 0) && (a_NBT.GetType(CustomNameTag) == TAG_String))
|
||||
{
|
||||
a_Monster.SetCustomName(a_NBT.GetString(CustomNameTag));
|
||||
}
|
||||
|
||||
int CustomNameVisibleTag = a_NBT.FindChildByName(a_TagIdx, "CustomNameVisible");
|
||||
if ((CustomNameVisibleTag > 0) && (a_NBT.GetType(CustomNameVisibleTag) == TAG_Byte))
|
||||
{
|
||||
bool CustomNameVisible = (a_NBT.GetByte(CustomNameVisibleTag) == 1);
|
||||
a_Monster.SetCustomNameAlwaysVisible(CustomNameVisible);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user