From a782ecb5b3a4c97b0ab3b76ce6872071ed6d8687 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 10 Nov 2024 14:07:35 -0500 Subject: [PATCH] Core/Object: Added max height change param to MovePosition Port From (https://github.com/TrinityCore/TrinityCore/commit/35b8868763cc46a16511b11a5c735dc534e887dc) --- Source/Game/Entities/Object/WorldObject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 892a55309..7156ba5d5 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -3658,7 +3658,7 @@ namespace Game.Entities GetNearPoint(obj, out x, out y, out z, distance2d, GetAbsoluteAngle(obj)); } - public void MovePosition(Position pos, float dist, float angle) + public void MovePosition(Position pos, float dist, float angle, float maxHeightChange = 6.0f) { angle += GetOrientation(); float destx = pos.posX + dist * (float)Math.Cos(angle); @@ -3680,7 +3680,7 @@ namespace Game.Entities for (byte j = 0; j < 10; ++j) { // do not allow too big z changes - if (Math.Abs(pos.posZ - destz) > 6) + if (Math.Abs(pos.posZ - destz) > maxHeightChange) { destx -= step * (float)Math.Cos(angle); desty -= step * (float)Math.Sin(angle);