Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5245,7 +5245,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (Creature const* targetCreature = dynamic_cast<Creature*>(target))
if ((!targetCreature->GetLootRecipientGuid().IsEmpty()) && !targetCreature->IsTappedBy(static_cast<Player*>(m_trueCaster)))
return SPELL_FAILED_CANT_CAST_ON_TAPPED;

// Do not allow spells to complete which are targeting players that are invisible to the caster since the time of cast start
if (!m_trueCaster->IsGameObject() && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && !IsPositiveEffectMask(m_spellInfo, affectedMask, m_trueCaster, target) && !target->IsVisibleForOrDetect(m_caster, m_trueCaster, false, false, true, false, m_spellInfo->HasAttribute(SPELL_ATTR_EX6_IGNORE_PHASE_SHIFT)))
return SPELL_FAILED_BAD_TARGETS;
Expand Down Expand Up @@ -5608,7 +5608,7 @@ SpellCastResult Spell::CheckCast(bool strict)
break;
}
}

if (inCombat)
return SPELL_FAILED_TARGET_IN_COMBAT;
}
Expand Down Expand Up @@ -7511,10 +7511,10 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff, bool targetB, bool n
{
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNTARGETABLE))
return false;

if (m_spellInfo->HasAttribute(SPELL_ATTR_EX_ONLY_PEACEFUL_TARGETS) && target->IsInCombat())
return false;
}
}

if (m_spellInfo->HasAttribute(SPELL_ATTR_EX3_NOT_ON_AOE_IMMUNE) || m_spellInfo->HasAttribute(SPELL_ATTR_EX5_TREAT_AS_AREA_EFFECT)) // rest done in aoe code
if (target->IsAOEImmune())
Expand Down Expand Up @@ -7855,7 +7855,7 @@ float Spell::GetSpellSpeed() const

if (m_overrideSpeed)
return m_overridenSpeed;

return m_spellInfo->speed;
}

Expand Down Expand Up @@ -8222,8 +8222,10 @@ void Spell::FilterTargetMap(UnitList& filterUnitList, SpellTargetFilterScheme sc
case SCHEME_CLOSEST_CHAIN:
{
Unit* unitTarget = m_targets.getUnitTarget();
if (filterUnitList.empty() || filterUnitList.front() != unitTarget)
if (filterUnitList.empty())
break;
if (!unitTarget)
unitTarget = filterUnitList.front();
UnitList newList;
newList.push_back(unitTarget);
filterUnitList.pop_front();
Expand Down