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
This commit is contained in:
Bohica 2025-07-16 21:55:47 -07:00 committed by GitHub
parent c1af2ade83
commit 2086e9b292
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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