A little change to let the patch apply on newer mangos:
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index 8de2644..23d431a 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -162,7 +162,7 @@ void PetAI::UpdateAI(const uint32 diff)
return;
}
// not required to be stopped case
- else if (m_creature->isAttackReady() && m_creature->canReachWithAttack(m_creature->getVictim()))
+ else if (m_creature->isAttackReady() && m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
@@ -335,6 +335,6 @@ void PetAI::AttackedBy(Unit *attacker)
{
//when attacked, fight back in case 1)no victim already AND 2)not set to passive AND 3)not set to stay, unless can it can reach attacker with melee attack anyway
if(!m_creature->getVictim() && m_creature->GetCharmInfo() && !m_creature->GetCharmInfo()->HasReactState(REACT_PASSIVE) &&
- (!m_creature->GetCharmInfo()->HasCommandState(COMMAND_STAY) || m_creature->canReachWithAttack(attacker)))
+ (!m_creature->GetCharmInfo()->HasCommandState(COMMAND_STAY) || m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)))
AttackStart(attacker);
}
Great job pasdVn, still the best