fix(Core/Pet): Pet chase range check for melee ranged spells (#2694)

Co-authored-by: Stoabrogga <[email protected]>
This commit is contained in:
Stefano Borzì
2020-03-25 17:34:04 +01:00
committed by GitHub
co-authored by Stoabrogga
parent fa57954ff9
commit 19144d8bff
+2
View File
@@ -443,6 +443,8 @@ void Pet::Update(uint32 diff)
if (!spellInfo)
return;
float max_range = GetSpellMaxRangeForTarget(tempspellTarget, spellInfo);
if (spellInfo->RangeEntry->type == SPELL_RANGE_MELEE)
max_range -= 2*MIN_MELEE_REACH;
if (IsWithinLOSInMap(tempspellTarget) && GetDistance(tempspellTarget) < max_range)
{