aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-06-24 12:49:15 +0200
committerccrs <ccrs@users.noreply.github.com>2019-06-24 12:49:15 +0200
commitebd438883e31de4482617631ff9939f2246fda69 (patch)
treef50d213ba6f182f2af285252dc63bc1c75b32ae9 /src
parente3e4b975ce1a7a4aa75d61aff7ab3da287b3ceff (diff)
Core/AI: minimize further undesired behaviours (e3e4b97 followup)
Those Category checks come from checking all Spell::SummonGuardian uses
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CreatureAI.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index cfb58a99826..c8dd13f53b5 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -21,6 +21,7 @@
#include "Creature.h"
#include "CreatureAIImpl.h"
#include "CreatureTextMgr.h"
+#include "DBCStructure.h"
#include "Language.h"
#include "Log.h"
#include "Map.h"
@@ -153,13 +154,22 @@ void CreatureAI::TriggerAlert(Unit const* who) const
void CreatureAI::JustAppeared()
{
- if (!me->GetVehicle())
+ // Filter which type of summons apply the following follow handling
+ if (!me->IsSummon())
+ return;
+
+ TempSummon* summon = me->ToTempSummon();
+ if (summon->m_Properties->Category != SUMMON_CATEGORY_UNK && summon->m_Properties->Category != SUMMON_CATEGORY_PET)
+ return;
+
+ // Not applied to vehicles
+ if (summon->GetVehicle())
+ return;
+
+ if (Unit* owner = summon->GetCharmerOrOwner())
{
- if (Unit* owner = me->GetCharmerOrOwner())
- {
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
- }
+ summon->GetMotionMaster()->Clear();
+ summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle());
}
}