diff options
| author | megamage <none@none> | 2009-05-26 15:31:47 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-05-26 15:31:47 -0500 |
| commit | 18252e5f796265c6e04b759d61e0af9f375d5188 (patch) | |
| tree | d078cd8afc5f4b7e6340bbf7df8bb154986f704b /src/game/Spell.cpp | |
| parent | 375be3648eff0210e5507e71f20cf2581c3cde9d (diff) | |
*Use original caster to check quest spell hit. This fixes the bug that some quest cannot be finished when using controlled creatures to cast spell.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
| -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); } } |
