mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[11674] Fixed names of pets summoned by npc.
* Add check to make sure that creature controlled pet use default name from template. * Add localization support to pet name query for above pets type.
This commit is contained in:
parent
adcae44c9a
commit
d8a3f4b925
3 changed files with 19 additions and 4 deletions
|
|
@ -326,6 +326,20 @@ void WorldSession::SendPetNameQuery(ObjectGuid petguid, uint32 petnumber)
|
|||
|
||||
std::string name = pet->GetName();
|
||||
|
||||
// creature pets have localization like other creatures
|
||||
if (!pet->GetOwnerGuid().IsPlayer())
|
||||
{
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
if (CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(pet->GetEntry()))
|
||||
{
|
||||
if (cl->Name.size() > size_t(loc_idx) && !cl->Name[loc_idx].empty())
|
||||
name = cl->Name[loc_idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_PET_NAME_QUERY_RESPONSE, (4+4+name.size()+1));
|
||||
data << uint32(petnumber);
|
||||
data << name.c_str();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue