mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user