mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[7148] Fixed possible crash at clone creatures without family.
Signed-off-by: zhenya <zhenya@mangos.ru> Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
100801b713
commit
7e76c7dff2
2 changed files with 4 additions and 5 deletions
|
|
@ -768,11 +768,10 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
|||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())/4);
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
||||
|
||||
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family);
|
||||
if( char* familyname = cFamily->Name[sWorld.GetDefaultDbcLocale()] )
|
||||
SetName(familyname);
|
||||
if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
|
||||
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
|
||||
else
|
||||
SetName(creature->GetName());
|
||||
SetName(creature->GetNameForLocaleIdx(objmgr.GetDBCLocaleIndex()));
|
||||
|
||||
if(cinfo->type == CREATURE_TYPE_BEAST)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue