[svn] Use IsWithinCombatDist for all AI. This should fix the bug that pet and guard does not attack target. (Note: some scriptedAI may need to update)
--HG-- branch : trunk
This commit is contained in:
@@ -124,7 +124,7 @@ AggressorAI::UpdateAI(const uint32 /*diff*/)
|
||||
|
||||
if( i_creature.isAttackReady() )
|
||||
{
|
||||
if( i_creature.IsWithinDistInMap(i_creature.getVictim(), ATTACK_DISTANCE))
|
||||
if( i_creature.IsWithinCombatDist(i_creature.getVictim(), ATTACK_DISTANCE))
|
||||
{
|
||||
i_creature.AttackerStateUpdate(i_creature.getVictim());
|
||||
i_creature.resetAttackTimer();
|
||||
|
||||
@@ -117,7 +117,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
|
||||
|
||||
if( i_creature.isAttackReady() )
|
||||
{
|
||||
if( i_creature.IsWithinDistInMap(i_creature.getVictim(), ATTACK_DISTANCE))
|
||||
if( i_creature.IsWithinCombatDist(i_creature.getVictim(), ATTACK_DISTANCE))
|
||||
{
|
||||
i_creature.AttackerStateUpdate(i_creature.getVictim());
|
||||
i_creature.resetAttackTimer();
|
||||
|
||||
+1
-1
@@ -164,7 +164,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
return;
|
||||
}
|
||||
// not required to be stopped case
|
||||
else if( i_pet.isAttackReady() && i_pet.canReachWithAttack(i_pet.getVictim()) )
|
||||
else if( i_pet.isAttackReady() && i_pet.IsWithinCombatDist(i_pet.getVictim(), ATTACK_DISTANCE) )
|
||||
{
|
||||
i_pet.AttackerStateUpdate(i_pet.getVictim());
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ ReactorAI::UpdateAI(const uint32 /*time_diff*/)
|
||||
|
||||
if( i_creature.isAttackReady() )
|
||||
{
|
||||
if( i_creature.IsWithinDistInMap(i_creature.getVictim(), ATTACK_DISTANCE))
|
||||
if( i_creature.IsWithinCombatDist(i_creature.getVictim(), ATTACK_DISTANCE))
|
||||
{
|
||||
i_creature.AttackerStateUpdate(i_creature.getVictim());
|
||||
i_creature.resetAttackTimer();
|
||||
|
||||
Reference in New Issue
Block a user