From 031df598ab444ae4ed3d3d66996168d3577fb29d Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 31 Mar 2009 09:18:39 -0600 Subject: *Try to fix crash. --HG-- branch : trunk --- src/game/TemporarySummon.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/game/TemporarySummon.cpp') diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp index fde2f4d7d84..4ae2c86b96a 100644 --- a/src/game/TemporarySummon.cpp +++ b/src/game/TemporarySummon.cpp @@ -174,8 +174,6 @@ void TempSummon::InitSummon(uint32 duration) if(m_type == TEMPSUMMON_MANUAL_DESPAWN) m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; - AIM_Initialize(); - if(!m_Properties) return; @@ -194,6 +192,18 @@ void TempSummon::InitSummon(uint32 duration) } } + if(owner) + { + 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()); + CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID); + } + } + if(m_Properties->Faction) setFaction(m_Properties->Faction); } -- cgit v1.2.3