fix: Fixes movement pathing while in combat (#2271)
This commit is contained in:
parent
051f22ff93
commit
ee1a40bb51
8 changed files with 10 additions and 16 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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}");
|
||||
|
||||
|
|
|
|||
|
|
@ -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}");
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue