aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CreatureAI.cpp12
-rw-r--r--src/server/game/AI/CreatureAI.h2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp4
3 files changed, 13 insertions, 5 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 1a468a4e8a1..a7d2888fc0b 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -151,6 +151,18 @@ void CreatureAI::TriggerAlert(Unit const* who) const
me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS, me->GetAbsoluteAngle(who));
}
+void CreatureAI::JustAppeared()
+{
+ if (!me->GetVehicle())
+ {
+ if (Unit* owner = me->GetCharmerOrOwner())
+ {
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
+ }
+ }
+}
+
void CreatureAI::EnterEvadeMode(EvadeReason why)
{
if (!_EnterEvadeMode(why))
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 5931b447d06..b8626ab4615 100644
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -141,7 +141,7 @@ class TC_GAME_API CreatureAI : public UnitAI
virtual bool IsEscorted() const { return false; }
// Called when creature appears in the world (spawn, respawn, grid load etc...)
- virtual void JustAppeared() { }
+ virtual void JustAppeared();
// Called at waypoint reached or point movement finished
virtual void MovementInform(uint32 /*type*/, uint32 /*id*/) { }
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 130aa55d41e..f0f95b22e44 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2245,8 +2245,6 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp
summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag);
summon->SetImmuneToAll(true);
-
- summon->AI()->EnterEvadeMode();
break;
}
default:
@@ -5357,8 +5355,6 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
summon->SetDisplayId(1126); // modelid1
}
- summon->AI()->EnterEvadeMode();
-
ExecuteLogEffectSummonObject(i, summon);
}
}