Scripts/FollowerAI: Some cleanup:

Port From (https://github.com/TrinityCore/TrinityCore/commit/8c3eb07889f72955879c8a0e0881b51befb60067)
This commit is contained in:
hondacrx
2022-01-02 13:06:01 -05:00
parent c4bc8c6362
commit 4c0eb3f2e2
5 changed files with 85 additions and 146 deletions
+6 -4
View File
@@ -1100,11 +1100,11 @@ namespace Game.Entities
}
}
public bool IsEscortNPC(bool onlyIfActive = true)
public bool IsEscorted()
{
CreatureAI ai = GetAI();
if (ai != null)
return ai.IsEscortNPC(onlyIfActive);
return ai.IsEscorted();
return false;
}
@@ -2302,8 +2302,10 @@ namespace Game.Entities
if (!victim.IsInAccessiblePlaceFor(this))
return false;
if (IsAIEnabled() && !GetAI().CanAIAttack(victim))
return false;
CreatureAI ai = GetAI();
if (ai != null)
if (!ai.CanAIAttack(victim))
return false;
// we cannot attack in evade mode
if (IsInEvadeMode())