Core/Movement: Implement MoveSplineFlag::Enter_Cycle
Port From (https://github.com/TrinityCore/TrinityCore/commit/61f3d51143b51b04169bd1c2ff0393d2b9be7c33)
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user