mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[11105] Melee attacks distance
Inspired by patch provided by Feanordev. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
aa4c1be8cf
commit
8e68d1bcaf
13 changed files with 77 additions and 43 deletions
|
|
@ -68,14 +68,14 @@ void
|
|||
ReactorAI::UpdateAI(const uint32 /*time_diff*/)
|
||||
{
|
||||
// update i_victimGuid if i_creature.getVictim() !=0 and changed
|
||||
if(!m_creature->SelectHostileTarget() || !m_creature->getVictim())
|
||||
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
|
||||
return;
|
||||
|
||||
i_victimGuid = m_creature->getVictim()->GetGUID();
|
||||
|
||||
if( m_creature->isAttackReady() )
|
||||
if (m_creature->isAttackReady())
|
||||
{
|
||||
if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim()))
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue