Default behaviour of pets for creatures changed to REACT_DEFENSIVE

Fixed typo: changed m_ReactSate to m_reactState
Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2008-10-26 18:24:45 +01:00
parent f8a94b84c3
commit 6f6a1a7608
3 changed files with 11 additions and 7 deletions

View file

@ -4038,12 +4038,16 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->setPetType(SUMMON_PET);
uint32 faction = m_caster->getFaction();
if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isTotem())
if(m_caster->GetTypeId() == TYPEID_UNIT)
{
Unit* owner = ((Totem*)m_caster)->GetOwner();
if(owner)
faction = owner->getFaction();
NewSummon->GetCharmInfo()->SetReactState(REACT_AGGRESSIVE);
if ( ((Creature*)m_caster)->isTotem() )
NewSummon->GetCharmInfo()->SetReactState(REACT_AGGRESSIVE);
else
NewSummon->GetCharmInfo()->SetReactState(REACT_DEFENSIVE);
}
NewSummon->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID());