diff options
-rw-r--r-- | src/game/SpellEffects.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 05f27b4567a..30fe8af0d0a 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6376,9 +6376,11 @@ void Spell::EffectKnockBack(uint32 i) return; } - float ratio = m_caster->GetCombatReach() / unitTarget->GetCombatReach(); - ratio = ratio * ratio * ratio; // volume = length^3 - ratio *= 0.1f; // dbc value + float ratio = m_caster->GetCombatReach() / std::max(unitTarget->GetCombatReach(), 1.0f); + if(ratio < 1.0f) + ratio = ratio * ratio * ratio * 0.1f; // volume = length^3 + else + ratio = 0.1f; // dbc value ratio float speedxy = float(m_spellInfo->EffectMiscValue[i]) * ratio; float speedz = float(damage) * ratio; if(speedxy < 0.1f && speedz < 0.1f) |