aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorArtamedes <ownedned123@gmail.com>2019-09-05 02:37:44 -0400
committerShauren <shauren.trinity@gmail.com>2021-12-18 21:37:02 +0100
commit913f0903a3264f14ea44356bc86dade81348a546 (patch)
treeb38e06a7050b621c666f523053ab22695326ac90 /src/server/game
parent00ba5df52b4ae90f01c7177028dc9411f3632bb5 (diff)
Scripts/Outland: Fix npc_ancestral_wolf not starting waypoint (#23763)
* Scripts/Outlands: Fix npc_ancestral_wolf not starting waypoint, and also add a way to not follow owner automatically in CreatureAI::JustAppeared() for tempsummons * fix nopch (cherry picked from commit 0b3a9e2a2b2537e7224d103947ad6028c6d2e5fe)
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp2
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.h3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 49ff7661302..b222d96985e 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -198,7 +198,7 @@ void CreatureAI::JustAppeared()
if (TempSummon* summon = me->ToTempSummon())
{
// Only apply this to specific types of summons
- if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties))
+ if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties) && summon->CanFollowOwner())
{
if (Unit* owner = summon->GetCharmerOrOwner())
{
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 7a3827694d3..27409d0209c 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -29,7 +29,7 @@
TempSummon::TempSummon(SummonPropertiesEntry const* properties, WorldObject* owner, bool isWorldObject) :
Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
-m_timer(0), m_lifetime(0)
+m_timer(0), m_lifetime(0), m_canFollowOwner(true)
{
if (owner)
m_summonerGUID = owner->GetGUID();
diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h
index c2d245744d2..04ca319f1dd 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.h
+++ b/src/server/game/Entities/Creature/TemporarySummon.h
@@ -60,6 +60,8 @@ class TC_GAME_API TempSummon : public Creature
ObjectGuid GetSummonerGUID() const { return m_summonerGUID; }
TempSummonType GetSummonType() const { return m_type; }
uint32 GetTimer() const { return m_timer; }
+ bool CanFollowOwner() const { return m_canFollowOwner; }
+ void SetCanFollowOwner(bool can) { m_canFollowOwner = can; }
SummonPropertiesEntry const* const m_Properties;
@@ -69,6 +71,7 @@ class TC_GAME_API TempSummon : public Creature
uint32 m_timer;
uint32 m_lifetime;
ObjectGuid m_summonerGUID;
+ bool m_canFollowOwner;
};
class TC_GAME_API Minion : public TempSummon