mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Spells: Corrected radius calculation
This commit is contained in:
@@ -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