Core/NPC: Creatures now alert when they detect stealthed players (#1060)

Creatures stop when they detect a stealthed player like in retail.
Closes #1020
This commit is contained in:
Jinyang li
2018-11-01 03:25:23 +08:00
committed by Barbz
parent 59f0d086a6
commit 4b6342b42f
13 changed files with 166 additions and 20 deletions

View File

@@ -674,7 +674,14 @@ void SmartAI::MoveInLineOfSight(Unit* who)
return;
if (me->CanStartAttack(who))
{
if (me->HasUnitState(UNIT_STATE_DISTRACTED))
{
me->ClearUnitState(UNIT_STATE_DISTRACTED);
me->GetMotionMaster()->Clear();
}
AttackStart(who);
}
}
bool SmartAI::CanAIAttack(const Unit* /*who*/) const