diff options
| author | Shauren <shauren.trinity@gmail.com> | 2012-11-26 11:11:30 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2012-11-26 11:11:30 +0100 |
| commit | 4dffccb93ff02dc47efabb1183a4e093519213e2 (patch) | |
| tree | c8e975f0dbc920a45de63beed0ac3183d58e386c /src/server/game/Spells/SpellInfo.cpp | |
| parent | 5e9acb33413de381e9eff1b515acccab36a33282 (diff) | |
Core/Spells: Corrected radius calculation
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index be4c522956c..fcfa441455e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -499,9 +499,14 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const if (!HasRadius()) return 0.0f; - float radius = RadiusEntry->radiusMax; - if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) - modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell); + float radius = RadiusEntry->RadiusMin; + if (caster) + { + radius += RadiusEntry->RadiusPerLevel * caster->getLevel(); + radius = std::min(radius, RadiusEntry->RadiusMax); + if (Player* modOwner = caster->GetSpellModOwner()) + modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell); + } return radius; } |
