Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

recheck distance for delayed spells at hit. related to #873, need test.

  • Loading branch information...
commit ba0e55a75a4766dbe28d9f27bae97561c3a6730a 1 parent c13a1cd
@rsa rsa authored
Showing with 9 additions and 7 deletions.
  1. +8 −6 src/game/Spell.cpp
  2. +1 −1  src/game/Spell.h
View
14 src/game/Spell.cpp
@@ -1110,9 +1110,11 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
}
// recheck for visibility of target
- if ((m_spellInfo->speed > 0.0f ||
- (m_spellInfo->EffectImplicitTargetA[0] == TARGET_CHAIN_DAMAGE && GetSpellCastTime(m_spellInfo, this) > 0)) &&
- (!unit->isVisibleForOrDetect(m_caster, m_caster, false) && !m_IsTriggeredSpell))
+ if (CheckRange(true, unit) != SPELL_CAST_OK ||
+ ((m_spellInfo->speed > 0.0f ||
+ (m_spellInfo->EffectImplicitTargetA[0] == TARGET_CHAIN_DAMAGE &&
+ GetSpellCastTime(m_spellInfo, this) > 0)) &&
+ (!unit->isVisibleForOrDetect(m_caster, m_caster, false) && !m_IsTriggeredSpell)))
{
caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
missInfo = SPELL_MISS_EVADE;
@@ -6848,10 +6850,10 @@ SpellCastResult Spell::CanAutoCast(Unit* target)
return result; //target invalid
}
-SpellCastResult Spell::CheckRange(bool strict)
+SpellCastResult Spell::CheckRange(bool strict, WorldObject* checkTarget)
{
- Unit *target = m_targets.getUnitTarget();
- GameObject *pGoTarget = m_targets.getGOTarget();
+ Unit* target = (checkTarget && checkTarget->GetObjectGuid().IsUnit()) ? (Unit*)checkTarget : m_targets.getUnitTarget();
+ GameObject* pGoTarget = (checkTarget && checkTarget->GetObjectGuid().IsGameObject()) ? (GameObject*)checkTarget : m_targets.getGOTarget();
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
View
2  src/game/Spell.h
@@ -398,7 +398,7 @@ class Spell
void _handle_finish_phase();
SpellCastResult CheckItems();
- SpellCastResult CheckRange(bool strict);
+ SpellCastResult CheckRange(bool strict, WorldObject* target = NULL);
SpellCastResult CheckPower();
SpellCastResult CheckOrTakeRunePower(bool take);
SpellCastResult CheckCasterAuras() const;

1 comment on commit ba0e55a

@raynar
Collaborator

Don't work at all. Now al charges show "evadir" (evade) :(

Please sign in to comment.
Something went wrong with that request. Please try again.