Core/SpellScript: Corrected when OnObjectAreaTargetSelect hooks are called (must be before splitting unit/go targets)
This commit is contained in:
@@ -1205,6 +1205,9 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
|
||||||
|
|
||||||
std::list<Unit*> unitTargets;
|
std::list<Unit*> unitTargets;
|
||||||
std::list<GameObject*> gObjTargets;
|
std::list<GameObject*> gObjTargets;
|
||||||
// for compability with older code - add only unit and go targets
|
// for compability with older code - add only unit and go targets
|
||||||
@@ -1217,8 +1220,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
|||||||
gObjTargets.push_back(gObjTarget);
|
gObjTargets.push_back(gObjTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
|
|
||||||
|
|
||||||
if (!unitTargets.empty())
|
if (!unitTargets.empty())
|
||||||
{
|
{
|
||||||
// Special target selection for smart heals and energizes
|
// Special target selection for smart heals and energizes
|
||||||
@@ -1562,15 +1563,15 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg
|
|||||||
SearchChainTargets(targets, maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType()
|
SearchChainTargets(targets, maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType()
|
||||||
, m_spellInfo->Effects[effIndex].ImplicitTargetConditions, targetType.GetTarget() == TARGET_UNIT_TARGET_CHAINHEAL_ALLY);
|
, m_spellInfo->Effects[effIndex].ImplicitTargetConditions, targetType.GetTarget() == TARGET_UNIT_TARGET_CHAINHEAL_ALLY);
|
||||||
|
|
||||||
|
// Chain primary target is added earlier
|
||||||
|
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
|
||||||
|
|
||||||
// for backward compability
|
// for backward compability
|
||||||
std::list<Unit*> unitTargets;
|
std::list<Unit*> unitTargets;
|
||||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||||
if (Unit* unitTarget = (*itr)->ToUnit())
|
if (Unit* unitTarget = (*itr)->ToUnit())
|
||||||
unitTargets.push_back(unitTarget);
|
unitTargets.push_back(unitTarget);
|
||||||
|
|
||||||
// Chain primary target is added earlier
|
|
||||||
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
|
|
||||||
|
|
||||||
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr)
|
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr)
|
||||||
AddUnitTarget(*itr, effMask, false);
|
AddUnitTarget(*itr, effMask, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user