Core/Spells: The first target of a chained spell should be explicit.
Closes #5643
This commit is contained in:
@@ -1008,7 +1008,7 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
|
||||
{
|
||||
case TARGET_OBJECT_TYPE_UNIT:
|
||||
if (Unit* unitTarget = target->ToUnit())
|
||||
AddUnitTarget(unitTarget, effMask, false);
|
||||
AddUnitTarget(unitTarget, effMask, true, false);
|
||||
break;
|
||||
case TARGET_OBJECT_TYPE_GOBJ:
|
||||
if (GameObject* gobjTarget = target->ToGameObject())
|
||||
@@ -1544,7 +1544,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli
|
||||
{
|
||||
ASSERT((m_targets.GetObjectTarget() || m_targets.GetItemTarget()) && "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!");
|
||||
if (Unit* unit = m_targets.GetUnitTarget())
|
||||
AddUnitTarget(unit, 1 << effIndex);
|
||||
AddUnitTarget(unit, 1 << effIndex, true, false);
|
||||
else if (GameObject* gobj = m_targets.GetGOTarget())
|
||||
AddGOTarget(gobj, 1 << effIndex);
|
||||
else
|
||||
@@ -2077,7 +2077,7 @@ void Spell::CleanupTargetList()
|
||||
m_delayMoment = 0;
|
||||
}
|
||||
|
||||
void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/)
|
||||
void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/, bool implicit /*= true*/)
|
||||
{
|
||||
for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||
if (!m_spellInfo->Effects[effIndex].IsEffect() || !CheckEffectTarget(target, effIndex))
|
||||
@@ -2088,7 +2088,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
|
||||
return;
|
||||
|
||||
if (checkIfValid)
|
||||
if (m_spellInfo->CheckTarget(m_caster, target, true) != SPELL_CAST_OK)
|
||||
if (m_spellInfo->CheckTarget(m_caster, target, implicit) != SPELL_CAST_OK)
|
||||
return;
|
||||
|
||||
// Check for effect immune skip if immuned
|
||||
|
||||
@@ -596,7 +596,7 @@ class Spell
|
||||
|
||||
SpellDestination m_destTargets[MAX_SPELL_EFFECTS];
|
||||
|
||||
void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true);
|
||||
void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true, bool implicit = true);
|
||||
void AddGOTarget(GameObject* target, uint32 effectMask);
|
||||
void AddItemTarget(Item* item, uint32 effectMask);
|
||||
void AddDestTarget(SpellDestination const& dest, uint32 effIndex);
|
||||
|
||||
Reference in New Issue
Block a user