Core/Spells: Corrected radius calculation

This commit is contained in:
Shauren
2012-11-26 11:11:30 +01:00
parent 5e9acb3341
commit 4dffccb93f
4 changed files with 13 additions and 8 deletions

View File

@@ -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;
}