diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 614d6d2f3..263988d73 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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()); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 339a59079..aaf107d4e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9808,7 +9808,7 @@ CharmInfo* Unit::InitCharmInfo(Unit *charm) } CharmInfo::CharmInfo(Unit* unit) -: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_ReactSate(REACT_PASSIVE), m_petnumber(0) +: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0) { for(int i =0; i<4; ++i) { diff --git a/src/game/Unit.h b/src/game/Unit.h index 6eb643843..99d6b61f2 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -643,9 +643,9 @@ struct CharmInfo void SetCommandState(CommandStates st) { m_CommandState = st; } CommandStates GetCommandState() { return m_CommandState; } bool HasCommandState(CommandStates state) { return (m_CommandState == state); } - void SetReactState(ReactStates st) { m_ReactSate = st; } - ReactStates GetReactState() { return m_ReactSate; } - bool HasReactState(ReactStates state) { return (m_ReactSate == state); } + void SetReactState(ReactStates st) { m_reactState = st; } + ReactStates GetReactState() { return m_reactState; } + bool HasReactState(ReactStates state) { return (m_reactState == state); } void InitPossessCreateSpells(); void InitCharmCreateSpells(); @@ -662,7 +662,7 @@ struct CharmInfo UnitActionBarEntry PetActionBar[10]; CharmSpellEntry m_charmspells[4]; CommandStates m_CommandState; - ReactStates m_ReactSate; + ReactStates m_reactState; uint32 m_petnumber; };