refactor(Core/Spell): Use ApplySpellFix with SpellInfo (#9938)

This commit is contained in:
Kitzunu
2022-02-08 14:09:15 +01:00
committed by GitHub
parent cfd9ebe107
commit 13643c969c
11 changed files with 1292 additions and 1268 deletions

View File

@@ -2275,8 +2275,8 @@ float SpellInfo::GetMinRange(bool positive) const
if (!RangeEntry)
return 0.0f;
if (positive)
return RangeEntry->minRangeFriend;
return RangeEntry->minRangeHostile;
return RangeEntry->RangeMin[1];
return RangeEntry->RangeMin[0];
}
float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
@@ -2285,9 +2285,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
return 0.0f;
float range;
if (positive)
range = RangeEntry->maxRangeFriend;
range = RangeEntry->RangeMax[1];
else
range = RangeEntry->maxRangeHostile;
range = RangeEntry->RangeMax[0];
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);