diff options
| author | Vincent_Michael <Vincent_Michael@gmx.de> | 2014-01-18 01:03:24 +0100 |
|---|---|---|
| committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2014-01-18 01:03:24 +0100 |
| commit | 3276a786cc35f4dddcceedcab84fba5e77b78e58 (patch) | |
| tree | f1222842d0631edfa14a7d6d6d436884056bafbe /src/server/game/Spells/SpellInfo.cpp | |
| parent | 4027686b5b127cf9865a51648de16fa5a51a2682 (diff) | |
| parent | de7a43a157a8b78220319c26332a71db087e50c9 (diff) | |
Merge branch '4.3.4' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a094bf0603d..334f0cd80d5 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -613,22 +613,18 @@ 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; - } + const SpellRadiusEntry* entry = RadiusEntry; + if (!HasRadius() && HasMaxRadius()) + entry = MaxRadiusEntry; + + if (!entry) return 0.0f; - } - 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); } |
