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/server/game/Spells/SpellInfo.cpp') 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 From 2d54b88d5726e1fc7c8f9df737f9b41c66418db6 Mon Sep 17 00:00:00 2001 From: Warpten Date: Wed, 15 Jan 2014 19:37:25 +0100 Subject: Core/Spells: Crash fix for f9ccb6f585a4714a93. Closes #11447. My bad. --- src/server/game/Spells/SpellInfo.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 1da4767ae18..334f0cd80d5 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -617,6 +617,9 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const if (!HasRadius() && HasMaxRadius()) entry = MaxRadiusEntry; + if (!entry) + return 0.0f; + float radius = entry->RadiusMin; if (caster) { -- cgit v1.2.3