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:
|
case TARGET_OBJECT_TYPE_UNIT:
|
||||||
if (Unit* unitTarget = target->ToUnit())
|
if (Unit* unitTarget = target->ToUnit())
|
||||||
AddUnitTarget(unitTarget, effMask, false);
|
AddUnitTarget(unitTarget, effMask, true, false);
|
||||||
break;
|
break;
|
||||||
case TARGET_OBJECT_TYPE_GOBJ:
|
case TARGET_OBJECT_TYPE_GOBJ:
|
||||||
if (GameObject* gobjTarget = target->ToGameObject())
|
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!");
|
ASSERT((m_targets.GetObjectTarget() || m_targets.GetItemTarget()) && "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!");
|
||||||
if (Unit* unit = m_targets.GetUnitTarget())
|
if (Unit* unit = m_targets.GetUnitTarget())
|
||||||
AddUnitTarget(unit, 1 << effIndex);
|
AddUnitTarget(unit, 1 << effIndex, true, false);
|
||||||
else if (GameObject* gobj = m_targets.GetGOTarget())
|
else if (GameObject* gobj = m_targets.GetGOTarget())
|
||||||
AddGOTarget(gobj, 1 << effIndex);
|
AddGOTarget(gobj, 1 << effIndex);
|
||||||
else
|
else
|
||||||
@@ -2077,7 +2077,7 @@ void Spell::CleanupTargetList()
|
|||||||
m_delayMoment = 0;
|
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)
|
for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||||
if (!m_spellInfo->Effects[effIndex].IsEffect() || !CheckEffectTarget(target, effIndex))
|
if (!m_spellInfo->Effects[effIndex].IsEffect() || !CheckEffectTarget(target, effIndex))
|
||||||
@@ -2088,7 +2088,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (checkIfValid)
|
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;
|
return;
|
||||||
|
|
||||||
// Check for effect immune skip if immuned
|
// Check for effect immune skip if immuned
|
||||||
|
|||||||
@@ -596,7 +596,7 @@ class Spell
|
|||||||
|
|
||||||
SpellDestination m_destTargets[MAX_SPELL_EFFECTS];
|
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 AddGOTarget(GameObject* target, uint32 effectMask);
|
||||||
void AddItemTarget(Item* item, uint32 effectMask);
|
void AddItemTarget(Item* item, uint32 effectMask);
|
||||||
void AddDestTarget(SpellDestination const& dest, uint32 effIndex);
|
void AddDestTarget(SpellDestination const& dest, uint32 effIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user