diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index abf4a5e897f..02c6083bde7 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1128,10 +1128,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // cast at creature (or GO) quest objectives update at successful cast finished (+channel finished) // ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm... ) - if(!((Creature*)spellHitTarget)->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() ) + if(m_originalCaster && m_originalCaster->IsControlledByPlayer() && !((Creature*)spellHitTarget)->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() ) { - if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() ) + if ( Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself() ) + { p->CastedCreatureOrGO(spellHitTarget->GetEntry(),spellHitTarget->GetGUID(),m_spellInfo->Id); + } } } @@ -1379,9 +1381,9 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target) // cast at creature (or GO) quest objectives update at successful cast finished (+channel finished) // ignore autorepeat/melee casts for speed (not exist quest for spells (hm... ) - if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() ) + if(m_originalCaster && m_originalCaster->IsControlledByPlayer() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() ) { - if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() ) + if ( Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself() ) p->CastedCreatureOrGO(go->GetEntry(),go->GetGUID(),m_spellInfo->Id); } } |