*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
This commit is contained in:
+6
-4
@@ -1128,12 +1128,14 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
|
|
||||||
// cast at creature (or GO) quest objectives update at successful cast finished (+channel finished)
|
// 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... )
|
// 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_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself() )
|
||||||
{
|
{
|
||||||
if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() )
|
|
||||||
p->CastedCreatureOrGO(spellHitTarget->GetEntry(),spellHitTarget->GetGUID(),m_spellInfo->Id);
|
p->CastedCreatureOrGO(spellHitTarget->GetEntry(),spellHitTarget->GetGUID(),m_spellInfo->Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled)
|
if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled)
|
||||||
((Creature*)m_caster)->AI()->SpellHitTarget(spellHitTarget, m_spellInfo);
|
((Creature*)m_caster)->AI()->SpellHitTarget(spellHitTarget, m_spellInfo);
|
||||||
@@ -1379,9 +1381,9 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target)
|
|||||||
|
|
||||||
// cast at creature (or GO) quest objectives update at successful cast finished (+channel finished)
|
// 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... )
|
// 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);
|
p->CastedCreatureOrGO(go->GetEntry(),go->GetGUID(),m_spellInfo->Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user