Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
Port From (https://github.com/TrinityCore/TrinityCore/commit/14939204955d1a24fe465cdfcbf307daf3ce4f09)
This commit is contained in:
@@ -44,7 +44,6 @@ namespace Game.Entities
|
||||
m_combatManager = new CombatManager(this);
|
||||
m_threatManager = new ThreatManager(this);
|
||||
_spellHistory = new SpellHistory(this);
|
||||
m_FollowingRefManager = new RefManager<Unit, ITargetedMovementGeneratorBase>();
|
||||
|
||||
ObjectTypeId = TypeId.Unit;
|
||||
ObjectTypeMask |= TypeMask.Unit;
|
||||
@@ -454,6 +453,8 @@ namespace Game.Entities
|
||||
|
||||
RemoveAreaAurasDueToLeaveWorld();
|
||||
|
||||
RemoveAllFollowers();
|
||||
|
||||
if (!GetCharmerGUID().IsEmpty())
|
||||
{
|
||||
Log.outFatal(LogFilter.Unit, "Unit {0} has charmer guid when removed from world", GetEntry());
|
||||
@@ -1312,6 +1313,13 @@ namespace Game.Entities
|
||||
|
||||
public Totem ToTotem() { return IsTotem() ? (this as Totem) : null; }
|
||||
public TempSummon ToTempSummon() { return IsSummon() ? (this as TempSummon) : null; }
|
||||
|
||||
void RemoveAllFollowers()
|
||||
{
|
||||
while (!m_followingMe.Empty())
|
||||
m_followingMe[0].SetTarget(null);
|
||||
}
|
||||
|
||||
public virtual void SetDeathState(DeathState s)
|
||||
{
|
||||
// Death state needs to be updated before RemoveAllAurasOnDeath() is called, to prevent entering combat
|
||||
@@ -1563,11 +1571,8 @@ namespace Game.Entities
|
||||
|
||||
public bool IsCharmedOwnedByPlayerOrPlayer() { return GetCharmerOrOwnerOrOwnGUID().IsPlayer(); }
|
||||
|
||||
public void AddFollower(FollowerReference pRef)
|
||||
{
|
||||
m_FollowingRefManager.InsertFirst(pRef);
|
||||
}
|
||||
public void RemoveFollower(FollowerReference pRef) { } //nothing to do yet
|
||||
public void FollowerAdded(AbstractFollower f) { m_followingMe.Add(f); }
|
||||
public void FollowerRemoved(AbstractFollower f) { m_followingMe.Remove(f); }
|
||||
|
||||
public uint GetCreatureTypeMask()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user