*Fix a bug that JustSummoned is not called and all related script bugs.
--HG-- branch : trunk
This commit is contained in:
@@ -176,10 +176,22 @@ void TempSummon::InitSummon(uint32 duration)
|
||||
if(m_type == TEMPSUMMON_MANUAL_DESPAWN)
|
||||
m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
|
||||
|
||||
Unit* owner = GetSummoner();
|
||||
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)
|
||||
return;
|
||||
|
||||
Unit* owner = GetSummoner();
|
||||
if(uint32 slot = m_Properties->Slot)
|
||||
{
|
||||
if(owner)
|
||||
@@ -194,18 +206,6 @@ 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user