Core/Movement: Implement MoveSplineFlag::Enter_Cycle

Port From (https://github.com/TrinityCore/TrinityCore/commit/61f3d51143b51b04169bd1c2ff0393d2b9be7c33)
This commit is contained in:
hondacrx
2022-01-07 10:44:03 -05:00
parent 1528e28b7a
commit d47f9f0171
7 changed files with 77 additions and 11 deletions
+6 -2
View File
@@ -797,8 +797,12 @@ namespace Game.Movement
float angle = pos.GetAbsoluteAngle(_owner.GetPositionX(), _owner.GetPositionY());
MoveSplineInit init = new(_owner);
init.args.path = new Vector3[stepCount];
for (byte i = 0; i < stepCount; angle += step, ++i)
init.args.path = new Vector3[stepCount + 1];
// add the owner's current position as starting point as it gets removed after entering the cycle
init.args.path[0] = new Vector3(_owner.GetPositionX(), _owner.GetPositionY(), _owner.GetPositionZ());
for (byte i = 1; i < stepCount; angle += step, ++i)
{
Vector3 point = new();
point.X = (float)(x + radius * Math.Cos(angle));