[6948] Fixed unattackable NPC summoned pets.

Not set player's pet only UNIT_FLAG_PVP_ATTACKABLE flag for creature's pets.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
False.Genesis 2008-12-26 15:15:01 +03:00 committed by VladimirMangos
parent 3488c1fee3
commit 82c94b4101
4 changed files with 9 additions and 4 deletions

View file

@ -10838,6 +10838,9 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
if(GetTypeId()==TYPEID_PLAYER)
pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
pet->SetFreeTalentPoints(pet->GetMaxTalentPointsForLevel(level));