diff options
author | Warpten <vertozor@gmail.com> | 2014-01-14 20:37:17 +0100 |
---|---|---|
committer | Warpten <vertozor@gmail.com> | 2014-01-14 20:37:17 +0100 |
commit | f9ccb6f585a4714a93f8422b31d89fd8287d3631 (patch) | |
tree | 83b063c5c514ddad28e8b1d1f7acdea3cd97b0f2 | |
parent | 4d80611a1095ca5e7681b48878dceac3ac2e4011 (diff) |
Core/Spells: Fixed issues with spells using MaxRadius not considering radius spellmods.
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a094bf0603d..1da4767ae18 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -613,22 +613,15 @@ bool SpellEffectInfo::HasMaxRadius() const float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const { - if (!HasRadius()) - { - if (HasMaxRadius()) - { - //! Still not sure which to pick. Anyway at the current time (Patch 4.3.4) most of the spell effects - //! have no radius mod per level, and RadiusMin is equal to RadiusMax. - return MaxRadiusEntry->RadiusMin; - } - return 0.0f; - } + const SpellRadiusEntry* entry = RadiusEntry; + if (!HasRadius() && HasMaxRadius()) + entry = MaxRadiusEntry; - float radius = RadiusEntry->RadiusMin; + float radius = entry->RadiusMin; if (caster) { - radius += RadiusEntry->RadiusPerLevel * caster->getLevel(); - radius = std::min(radius, RadiusEntry->RadiusMax); + radius += entry->RadiusPerLevel * caster->getLevel(); + radius = std::min(radius, entry->RadiusMax); if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell); } |