Core/Creature: 2d1ef6b5b0 followup

closes #20532
This commit is contained in:
ccrs
2017-11-22 20:54:19 +01:00
parent 5241c1ad71
commit caefe2b43e

View File

@@ -2673,7 +2673,7 @@ uint32 Creature::GetPetAutoSpellOnPos(uint8 pos) const
float Creature::GetPetChaseDistance() const
{
float range = MELEE_RANGE;
float range = 0.f;
for (uint8 i = 0; i < GetPetAutoSpellSize(); ++i)
{
@@ -2683,10 +2683,8 @@ float Creature::GetPetChaseDistance() const
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID))
{
if (spellInfo->GetRecoveryTime() == 0 && // No cooldown
spellInfo->RangeEntry->ID != 1 /*Self*/ && spellInfo->RangeEntry->ID != 2 /*Combat Range*/ &&
spellInfo->GetMinRange() > range)
range = spellInfo->GetMinRange();
if (spellInfo->GetRecoveryTime() == 0 && spellInfo->RangeEntry->ID != 1 /*Self*/ && spellInfo->RangeEntry->ID != 2 /*Combat Range*/ && spellInfo->GetMaxRange() > range)
range = spellInfo->GetMaxRange();
}
}