Core/AI: Clean up charm AI handling.
Port From (https://github.com/TrinityCore/TrinityCore/commit/e4e8c1c59c8b37216814526b4d2551f23934f465)
This commit is contained in:
@@ -45,11 +45,11 @@ namespace Game.Maps
|
||||
|
||||
if (!c.HasUnitState(UnitState.Sightless))
|
||||
{
|
||||
if (c.IsAIEnabled && c.CanSeeOrDetect(u, false, true))
|
||||
if (c.IsAIEnabled() && c.CanSeeOrDetect(u, false, true))
|
||||
c.GetAI().MoveInLineOfSight_Safe(u);
|
||||
else
|
||||
{
|
||||
if (u.IsTypeId(TypeId.Player) && u.HasStealthAura() && c.IsAIEnabled && c.CanSeeOrDetect(u, false, true, true))
|
||||
if (u.IsTypeId(TypeId.Player) && u.HasStealthAura() && c.IsAIEnabled() && c.CanSeeOrDetect(u, false, true, true))
|
||||
c.GetAI().TriggerAlert(u);
|
||||
}
|
||||
}
|
||||
@@ -939,8 +939,7 @@ namespace Game.Maps
|
||||
if (!u.IsWithinLOSInMap(i_enemy))
|
||||
return;
|
||||
|
||||
if (u.GetAI() != null)
|
||||
u.GetAI().AttackStart(i_enemy);
|
||||
u.EngageWithTarget(i_enemy);
|
||||
}
|
||||
|
||||
Unit i_funit;
|
||||
|
||||
Reference in New Issue
Block a user