diff options
| author | megamage <none@none> | 2008-12-03 17:30:14 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-12-03 17:30:14 -0600 |
| commit | cd4e545155417593c670d72bbf9625962e0a9eda (patch) | |
| tree | 06dfe0b106df4f5010e3df04802aa744855eb0e0 /src | |
| parent | b36929bc79c164d2a0e727d35445d7c700b5d762 (diff) | |
*Use dest to calculate time delay for missile spells. (Only SPELL_EFFECT_TRIGGER_MISSILE for now, need to fix all "dest required spells")
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Spell.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 07905bb1c37..35e5dbd815f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -800,7 +800,13 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex) if (m_spellInfo->speed > 0.0f) { // calculate spell incoming interval - float dist = m_caster->GetDistance(pVictim->GetPositionX(), pVictim->GetPositionY(), pVictim->GetPositionZ()); + // TODO: this is a hack + float dist; + if(m_spellInfo->Effect[effIndex] == SPELL_EFFECT_TRIGGER_MISSILE && m_targets.HasDest()) + dist = m_caster->GetDistance(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ); + else + dist = m_caster->GetDistance(pVictim->GetPositionX(), pVictim->GetPositionY(), pVictim->GetPositionZ()); + if (dist < 5.0f) dist = 5.0f; target.timeDelay = (uint64) floor(dist / m_spellInfo->speed * 1000.0f); |
