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

@@ -14383,7 +14383,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
return 0;
if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile)
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
return spellInfo->GetMaxRange();
if (target == nullptr)
return spellInfo->GetMaxRange(true);
@@ -14394,7 +14394,7 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
return 0;
if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile)
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
return spellInfo->GetMinRange();
return spellInfo->GetMinRange(!IsHostileTo(target));
}