Merge pull request #5742 from MrSmite/PetAI_1
Core/Pets: Correctly obey the stay command for pets when attacking in melee range
This commit is contained in:
@@ -457,7 +457,7 @@ bool PetAI::CanAttack(Unit* target)
|
|||||||
|
|
||||||
// Stay - can attack if target is within range or commanded to
|
// Stay - can attack if target is within range or commanded to
|
||||||
if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY))
|
if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY))
|
||||||
return (me->IsWithinMeleeRange(target, MIN_MELEE_REACH) || me->GetCharmInfo()->IsCommandAttack());
|
return (me->IsWithinMeleeRange(target, MELEE_RANGE) || me->GetCharmInfo()->IsCommandAttack());
|
||||||
|
|
||||||
// Follow
|
// Follow
|
||||||
if (me->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
|
if (me->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
|
||||||
|
|||||||
Reference in New Issue
Block a user