mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 13:35:08 +00:00
fix(Core/Spells): Fixed getting max spell range for friendly targets. (#10906)
Fixes #10802
This commit is contained in:
@@ -14386,20 +14386,35 @@ void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply)
|
|||||||
float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
|
float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
|
||||||
{
|
{
|
||||||
if (!spellInfo->RangeEntry)
|
if (!spellInfo->RangeEntry)
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
|
}
|
||||||
|
|
||||||
|
if (spellInfo->RangeEntry->RangeMax[1] == spellInfo->RangeEntry->RangeMax[0])
|
||||||
|
{
|
||||||
return spellInfo->GetMaxRange();
|
return spellInfo->GetMaxRange();
|
||||||
if (target == nullptr)
|
}
|
||||||
|
|
||||||
|
if (!target)
|
||||||
|
{
|
||||||
return spellInfo->GetMaxRange(true);
|
return spellInfo->GetMaxRange(true);
|
||||||
|
}
|
||||||
|
|
||||||
return spellInfo->GetMaxRange(!IsHostileTo(target));
|
return spellInfo->GetMaxRange(!IsHostileTo(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
|
float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
|
||||||
{
|
{
|
||||||
if (!spellInfo->RangeEntry)
|
if (!spellInfo->RangeEntry)
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
|
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
|
||||||
|
{
|
||||||
return spellInfo->GetMinRange();
|
return spellInfo->GetMinRange();
|
||||||
|
}
|
||||||
|
|
||||||
return spellInfo->GetMinRange(!IsHostileTo(target));
|
return spellInfo->GetMinRange(!IsHostileTo(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user