aboutsummaryrefslogtreecommitdiff
path: root/src/game/TemporarySummon.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-06-10 08:45:45 +0200
committerMachiavelli <none@none>2009-06-10 08:45:45 +0200
commitee9beadbc20d24ec11346858db36c029c9c04b90 (patch)
treead8d5f89f9b7e1418c5bc00990370224b91453f3 /src/game/TemporarySummon.cpp
parentf137dc02ecadb515928655dd6603f33187731fec (diff)
parentc9d9ae1e491243f82be5ac84dc2ad51dfbae35eb (diff)
Merge
--HG-- branch : trunk
Diffstat (limited to 'src/game/TemporarySummon.cpp')
-rw-r--r--src/game/TemporarySummon.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
index 7a405fc57ec..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,13 +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());
- CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID);
- }
}
}