Core/SAI: Fix an issue where SAI was ignoring civilian and passive unit flags

Closes #2526
Disclaimer: This was not thoroughly tested; report any issue caused by this change.
This commit is contained in:
Nay
2011-10-01 16:29:23 +01:00
parent 269274f347
commit 0f7d9e4837
2 changed files with 3 additions and 7 deletions

View File

@@ -469,6 +469,9 @@ void SmartAI::MoveInLineOfSight(Unit* who)
if (!CanAIAttack(who))
return;
if (!me->canStartAttack(who, false))
return;
if (me->IsHostileTo(who))
{
@@ -487,9 +490,6 @@ void SmartAI::MoveInLineOfSight(Unit* who)
}
}
}
//if (me->canStartAttack(who, false))
// AttackStart(who);
}
bool SmartAI::CanAIAttack(const Unit* /*who*/) const

View File

@@ -1025,15 +1025,11 @@ namespace Trinity
return false;
if (m_force)
{
if (!me->IsValidAttackTarget(u))
return false;
}
else
{
if (!me->canStartAttack(u, false))
return false;
}
m_range = me->GetDistance(u); // use found unit range as new range limit for next check
return true;