Core/Spells: Corrected radius calculation
This commit is contained in:
1 parent
5e9acb3341
commit
4dffccb93f
4 files changed
+13
-8
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user