From 3d4bebd8d9210fbb84f8fc75742e248071192b09 Mon Sep 17 00:00:00 2001 From: Treeston Date: Thu, 1 Aug 2019 18:32:26 +0200 Subject: Scripts/FollowerAI: Some cleanup: - FollowerAI properly resumes follow after evading. - Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing - FollowerAI properly assists in combat. - FollowerAI properly despawns if quest is abandoned. - FollowerAI now supports dynamic respawning for escort NPCs. --- src/server/game/Entities/Creature/Creature.cpp | 6 +++--- src/server/game/Entities/Creature/Creature.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/game/Entities/Creature') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 9457b8bfde7..6d708476b96 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -3285,10 +3285,10 @@ void Creature::AtDisengage() } } -bool Creature::IsEscortNPC(bool onlyIfActive) +bool Creature::IsEscorted() const { - if (CreatureAI* ai = AI()) - return ai->IsEscortNPC(onlyIfActive); + if (CreatureAI const* ai = AI()) + return ai->IsEscorted(); return false; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index e2016f09cc4..90f69dcb5a1 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -355,7 +355,7 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma CreatureTextRepeatIds GetTextRepeatGroup(uint8 textGroup); void SetTextRepeatId(uint8 textGroup, uint8 id); void ClearTextRepeatGroup(uint8 textGroup); - bool IsEscortNPC(bool onlyIfActive = true); + bool IsEscorted() const; bool CanGiveExperience() const; -- cgit v1.2.3