diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 9154ca76a..3f7433e58 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -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(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c7a56f1a1..7845bf918 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5651,14 +5651,15 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx) NewSummon->InitLevelupSpellsForLevel(); NewSummon->InitTalentForLevel(); - if(NewSummon->getPetType() == SUMMON_PET) + if (m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->getPetType() == SUMMON_PET) { // generate new name for summon pet std::string new_name = sObjectMgr.GeneratePetName(petentry); - if(!new_name.empty()) + if (!new_name.empty()) NewSummon->SetName(new_name); } - else if(NewSummon->getPetType() == HUNTER_PET) + + if (NewSummon->getPetType() == HUNTER_PET) { NewSummon->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); NewSummon->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_ABANDONED); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e32de2ea6..089f7387c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11673" + #define REVISION_NR "11674" #endif // __REVISION_NR_H__