fix: Fixes movement pathing while in combat (#2271)

This commit is contained in:
Bohica 2025-11-16 10:14:06 -08:00 committed by GitHub
parent 051f22ff93
commit ee1a40bb51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 10 additions and 16 deletions

View file

@ -55,7 +55,7 @@ public class AnimalAI : BaseAI
return true;
}
if (!WalkMobileRange(combatant, 1, true, Mobile.RangeFight, Mobile.RangeFight))
if (!WalkMobileRange(combatant, 1, false, Mobile.RangeFight, Mobile.RangeFight))
{
if (Mobile.GetDistanceToSqrt(combatant) > Mobile.RangePerception + 1)
{

View file

@ -41,13 +41,7 @@ public class ArcherAI : BaseAI
return true;
}
if (Core.TickCount - Mobile.LastMoveTime > 1000 && !WalkMobileRange(
combatant,
1,
true,
Mobile.RangeFight,
Mobile.Weapon.MaxRange
))
if (!WalkMobileRange(combatant, 1, false, Mobile.RangeFight, Mobile.Weapon.MaxRange))
{
this.DebugSayFormatted($"I am still not in range of {combatant.Name}");

View file

@ -38,7 +38,7 @@ public class BerserkAI : BaseAI
return true;
}
if (!WalkMobileRange(combatant, 1, true, Mobile.RangeFight, Mobile.RangeFight))
if (!WalkMobileRange(combatant, 1, false, Mobile.RangeFight, Mobile.RangeFight))
{
this.DebugSayFormatted($"I am still not in range of {combatant.Name}");

View file

@ -168,7 +168,7 @@ public class MageAI : BaseAI
{
if (!SmartAI)
{
if (!MoveTo(m, true, Mobile.RangeFight))
if (!MoveTo(m, false, Mobile.RangeFight))
{
OnFailedMove();
}
@ -182,14 +182,14 @@ public class MageAI : BaseAI
{
RunFrom(m);
}
else if (!Mobile.InRange(m, Math.Max(Mobile.RangeFight, 2)) && !MoveTo(m, true, 1))
else if (!Mobile.InRange(m, Math.Max(Mobile.RangeFight, 2)) && !MoveTo(m, false, 1))
{
OnFailedMove();
}
}
else if (!Mobile.InRange(m, Mobile.RangeFight))
{
if (!MoveTo(m, true, 1))
if (!MoveTo(m, false, 1))
{
OnFailedMove();
}

View file

@ -67,7 +67,7 @@ public class MeleeAI : BaseAI
}
}
if (!MoveTo(combatant, true, Mobile.RangeFight))
if (!MoveTo(combatant, false, Mobile.RangeFight))
{
if (AcquireFocusMob(Mobile.RangePerception, Mobile.FightMode, false, false, true))
{

View file

@ -41,7 +41,7 @@ public class PredatorAI : BaseAI
return true;
}
if (!WalkMobileRange(combatant, 1, true, Mobile.RangeFight, Mobile.RangeFight))
if (!WalkMobileRange(combatant, 1, false, Mobile.RangeFight, Mobile.RangeFight))
{
if (Mobile.GetDistanceToSqrt(combatant) > Mobile.RangePerception + 1)
{

View file

@ -43,7 +43,7 @@ public class ThiefAI : BaseAI
return true;
}
if (!WalkMobileRange(combatant, 1, true, Mobile.RangeFight, Mobile.RangeFight))
if (!WalkMobileRange(combatant, 1, false, Mobile.RangeFight, Mobile.RangeFight))
{
this.DebugSayFormatted($"I should be closer to {combatant.Name}");
}

View file

@ -93,7 +93,7 @@ public abstract partial class BaseFamiliar : BaseCreature
Hidden = m_LastHidden = master.Hidden;
}
if (AIObject?.WalkMobileRange(master, 5, true, 1, 1) == true)
if (AIObject?.WalkMobileRange(master, 5, false, 1, 1) == true)
{
Warmode = master.Warmode;
Combatant = master.Combatant;