Core/Misc: movement cleanup

Port From (https://github.com/TrinityCore/TrinityCore/commit/4793b073eec2af32622ff703911721100730e868)
This commit is contained in:
hondacrx
2021-09-26 12:17:10 -04:00
parent e747de7608
commit 569e20ebc1
12 changed files with 76 additions and 48 deletions
+4 -3
View File
@@ -97,10 +97,11 @@ namespace Game.AI
return new NullCreatureAI(creature);
}
public static IMovementGenerator SelectMovementAI(Creature creature)
public static IMovementGenerator SelectMovementAI(Unit unit)
{
MovementGeneratorType type = MovementGeneratorType.Idle;
if (creature.GetPlayerMovingMe() == null)
MovementGeneratorType type = unit.GetDefaultMovementType();
Creature creature = unit.ToCreature();
if (creature != null && creature.GetPlayerMovingMe() == null)
type = creature.GetDefaultMovementType();
return type switch