Core/Movement: Delay creating MoveSplineInit objects used by GenericMovementGenerator to spline launch time

Port From (https://github.com/TrinityCore/TrinityCore/commit/36dde87249e87c5693162a6e890875d828f93d6d)
This commit is contained in:
hondacrx
2022-06-15 15:48:07 -04:00
parent 5ff87102ca
commit f91230ae33
7 changed files with 154 additions and 127 deletions
+6 -4
View File
@@ -234,10 +234,12 @@ namespace Game.Entities
public void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false)
{
MoveSplineInit init = new(this);
init.MoveTo(x, y, z, generatePath, forceDestination);
init.SetVelocity(speed);
GetMotionMaster().LaunchMoveSpline(init, 0, MovementGeneratorPriority.Normal, MovementGeneratorType.Point);
var initializer = (MoveSplineInit init) =>
{
init.MoveTo(x, y, z, generatePath, forceDestination);
init.SetVelocity(speed);
};
GetMotionMaster().LaunchMoveSpline(initializer, 0, MovementGeneratorPriority.Normal, MovementGeneratorType.Point);
}
public void KnockbackFrom(Position origin, float speedXY, float speedZ, SpellEffectExtraData spellEffectExtraData = null)