Core/Movement: MotionMaster reimplementation

Port From (https://github.com/TrinityCore/TrinityCore/commit/426f9f2f92b26fbb68e7cda9290ccbd586c6af4e)
This commit is contained in:
hondacrx
2021-09-29 18:24:37 -04:00
parent cf13f32062
commit a968772bad
47 changed files with 1954 additions and 1227 deletions
+4 -4
View File
@@ -110,7 +110,7 @@ namespace Game.Entities
public bool IsReturningHome()
{
if (GetMotionMaster().GetMotionSlotType(MovementSlot.Active) == MovementGeneratorType.Home)
if (GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Home)
return true;
return false;
@@ -551,8 +551,7 @@ namespace Game.Entities
{
Unit charmer = Global.ObjAccessor.GetUnit(this, LastCharmerGUID);
if (charmer)
if (CanStartAttack(charmer, true))
i_AI.AttackStart(charmer);
EngageWithTarget(charmer);
}
LastCharmerGUID.Clear();
@@ -1917,7 +1916,8 @@ namespace Game.Entities
SetNativeDisplayId(display.CreatureDisplayID, display.DisplayScale);
}
GetMotionMaster().InitDefault();
GetMotionMaster().InitializeDefault();
//Re-initialize reactstate that could be altered by movementgenerators
InitializeReactState();