From f9ccb6f585a4714a93f8422b31d89fd8287d3631 Mon Sep 17 00:00:00 2001 From: Warpten Date: Tue, 14 Jan 2014 20:37:17 +0100 Subject: Core/Spells: Fixed issues with spells using MaxRadius not considering radius spellmods. --- src/server/game/Spells/SpellInfo.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3