Core/Movement: remove redundant method MovementGenerator::NotifyAIOnFinalize and use existing Finalize - MovementInform implementation

Port From (https://github.com/TrinityCore/TrinityCore/commit/0e0deaefd4e84c8069f6249778774f605fc5e628)
This commit is contained in:
hondacrx
2022-05-26 20:08:35 -04:00
parent 20a4e31167
commit 558e976a5e
5 changed files with 13 additions and 17 deletions
@@ -16,6 +16,7 @@
*/
using Framework.Constants;
using Game.AI;
using Game.Entities;
using System;
@@ -208,9 +209,9 @@ namespace Game.Movement
TimeTracker _timer;
}
public class TimedFleeingGenerator : FleeingMovementGenerator<Creature>
public class TimedFleeingMovementGenerator : FleeingMovementGenerator<Creature>
{
public TimedFleeingGenerator(ObjectGuid fright, uint time) : base(fright)
public TimedFleeingMovementGenerator(ObjectGuid fright, uint time) : base(fright)
{
_totalFleeTime = new TimeTracker(time);
}
@@ -243,6 +244,14 @@ namespace Game.Movement
owner.ToCreature().GetAI().AttackStart(victim);
}
}
if (movementInform)
{
Creature ownerCreature = owner.ToCreature();
CreatureAI ai = ownerCreature != null ? ownerCreature.GetAI() : null;
if (ai != null)
ai.MovementInform(MovementGeneratorType.TimedFleeing, 0);
}
}
public override MovementGeneratorType GetMovementGeneratorType()
@@ -61,12 +61,6 @@ namespace Game.Movement
return false;
}
public void NotifyAIOnFinalize(Unit obj)
{
UnitAI ai = obj.GetAI();
ai?.OnMovementGeneratorFinalized(GetMovementGeneratorType());
}
public void AddFlag(MovementGeneratorFlags flag) { Flags |= flag; }
public bool HasFlag(MovementGeneratorFlags flag) { return (Flags & flag) != 0; }
public void RemoveFlag(MovementGeneratorFlags flag) { Flags &= ~flag; }