From 2086e9b292b1cd5484c9dc9a02b44c05da1170cf Mon Sep 17 00:00:00 2001 From: Bohica <53943479+Bohicatv@users.noreply.github.com> Date: Wed, 16 Jul 2025 21:55:47 -0700 Subject: [PATCH] fix: Fixes direction snapping when pathing to combatant for MeleeAI (#2187) * fix: Fixes direction snapping when pathing to combatant * Fixes speed when exiting out of flee action --- Projects/UOContent/Mobiles/AI/MeleeAI.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Projects/UOContent/Mobiles/AI/MeleeAI.cs b/Projects/UOContent/Mobiles/AI/MeleeAI.cs index 5bb697a1b..f431b1d23 100644 --- a/Projects/UOContent/Mobiles/AI/MeleeAI.cs +++ b/Projects/UOContent/Mobiles/AI/MeleeAI.cs @@ -81,7 +81,11 @@ public class MeleeAI : BaseAI if (!MoveTo(combatant, true, m_Mobile.RangeFight)) { - m_Mobile.Direction = m_Mobile.GetDirectionTo(combatant); + if (m_Mobile.InRange(combatant, 1)) + { + m_Mobile.Direction = m_Mobile.GetDirectionTo(combatant); + } + if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { if (m_Mobile.Debug) @@ -175,6 +179,8 @@ public class MeleeAI : BaseAI m_Mobile.DebugSay("I am stronger now, so I will continue fighting"); } + m_Mobile.PlaySound(m_Mobile.GetAttackSound()); + m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; Action = ActionType.Combat; } else