Core/AI: Remove EnterEvadeMode calls from Guardian/Summon spell handlers. Add follow logic to CreatureAI::JustAppeared.

Port From (https://github.com/TrinityCore/TrinityCore/commit/9f7d3ebd6a474c2e325698b1665ab2939926cab6)
This commit is contained in:
hondacrx
2021-12-23 20:23:16 -05:00
parent e28b42b270
commit 2d87d0c75d
2 changed files with 17 additions and 51 deletions
+14 -3
View File
@@ -149,6 +149,20 @@ namespace Game.AI
me.GetMotionMaster().MoveDistract(5 * Time.InMilliseconds, me.GetAbsoluteAngle(who));
}
// Called when creature appears in the world (spawn, respawn, grid load etc...)
public virtual void JustAppeared()
{
if (me.GetVehicle() == null)
{
Unit owner = me.GetCharmerOrOwner();
if (owner != null)
{
me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, me.GetFollowAngle());
}
}
}
// Called for reaction at stopping attack at no attackers or targets
public virtual void EnterEvadeMode(EvadeReason why = EvadeReason.Other)
{
@@ -393,9 +407,6 @@ namespace Game.AI
public virtual bool IsEscorted() { return false; }
// Called when creature appears in the world (spawn, respawn, grid load etc...)
public virtual void JustAppeared() { }
public virtual void MovementInform(MovementGeneratorType type, uint id) { }
// Called when a spell cast gets interrupted