[svn] Make mobs scatter around in melee attack. Patch provided by smellbee.

Fix Join Instance Can Enter while Encounter is in Progress. Patch provided by mknjc.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-10-27 08:00:33 -05:00
parent e2c221b0da
commit 1f7ff81049
4 changed files with 20 additions and 4 deletions
+2 -2
View File
@@ -92,7 +92,7 @@ void ScriptedAI::UpdateAI(const uint32 diff)
if (m_creature->isAttackReady() )
{
//If we are within range melee the target
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
@@ -148,7 +148,7 @@ void ScriptedAI::DoMeleeAttackIfReady()
if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
{
//If we are within range melee the target
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();