diff options
author | megamage <none@none> | 2009-06-09 22:01:35 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-09 22:01:35 -0500 |
commit | e922351bf04760bec1a0b1efe6bb1be1b28fc260 (patch) | |
tree | e2b87194bade025c3177799ae93c8be40ac3fab4 /src/game/TemporarySummon.cpp | |
parent | 2ce7109f6704e91d4e890efc1f5f7d017ce6ca2c (diff) |
*Fix a bug that triggers show level up visual when summoned.
--HG--
branch : trunk
Diffstat (limited to 'src/game/TemporarySummon.cpp')
-rw-r--r-- | src/game/TemporarySummon.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp index d10f45dd7dd..b481afb4bce 100644 --- a/src/game/TemporarySummon.cpp +++ b/src/game/TemporarySummon.cpp @@ -176,12 +176,22 @@ void TempSummon::InitStats(uint32 duration) if(m_type == TEMPSUMMON_MANUAL_DESPAWN) m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; + Unit *owner = GetSummoner(); + + if(owner && isTrigger() && m_spells[0]) + { + setFaction(owner->getFaction()); + SetLevel(owner->getLevel()); + if(owner->GetTypeId() == TYPEID_PLAYER) + m_ControlledByPlayer = true; + } + if(!m_Properties) return; - if(uint32 slot = m_Properties->Slot) + if(owner) { - if(Unit *owner = GetSummoner()) + if(uint32 slot = m_Properties->Slot) { if(owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID()) { @@ -204,12 +214,6 @@ void TempSummon::InitSummon() { if(owner->GetTypeId()==TYPEID_UNIT && ((Creature*)owner)->IsAIEnabled) ((Creature*)owner)->AI()->JustSummoned(this); - - if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && m_spells[0]) - { - setFaction(owner->getFaction()); - SetLevel(owner->getLevel()); - } } } |