[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:
seirge 2009-01-23 01:25:17 +03:00 committed by VladimirMangos
parent 100801b713
commit 7e76c7dff2
2 changed files with 4 additions and 5 deletions

View file

@ -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)
{