*Fix a bug that triggers show level up visual when summoned.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-09 22:01:35 -05:00
parent 2ce7109f67
commit e922351bf0
+12 -8
View File
@@ -176,12 +176,22 @@ void TempSummon::InitStats(uint32 duration)
if(m_type == TEMPSUMMON_MANUAL_DESPAWN) if(m_type == TEMPSUMMON_MANUAL_DESPAWN)
m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_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) if(!m_Properties)
return; 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()) 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) if(owner->GetTypeId()==TYPEID_UNIT && ((Creature*)owner)->IsAIEnabled)
((Creature*)owner)->AI()->JustSummoned(this); ((Creature*)owner)->AI()->JustSummoned(this);
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && m_spells[0])
{
setFaction(owner->getFaction());
SetLevel(owner->getLevel());
}
} }
} }