feat: add pickup radius
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Client.Domain.AI.Combat
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Drop> GetDropByConfig(WorldHandler worldHandler, Config config)
|
||||
public static List<Drop> GetDropByConfig(WorldHandler worldHandler, Config config, Hero hero)
|
||||
{
|
||||
if (!config.Combat.PickupIfPossible)
|
||||
{
|
||||
@@ -49,6 +49,8 @@ namespace Client.Domain.AI.Combat
|
||||
result = result.Where(x => config.Combat.IncludedItemIdsToPickup.ContainsKey(x.ItemId));
|
||||
}
|
||||
|
||||
result = result.Where(x => x.Transform.Position.HorizontalDistance(hero.Transform.Position) <= config.Combat.PickupRadius);
|
||||
|
||||
return result.ToList();
|
||||
}
|
||||
|
||||
|
@@ -35,9 +35,6 @@ namespace Client.Domain.AI.Combat
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO если нет цели, а тебя атаковали, то моб берется автоматом в таргет, из-за этого баг в Rest и MoveToSpot
|
||||
// а без этой проверки зацикливается MoveToTarget->FindTarget->MoveToTarget
|
||||
// один из вариантов решения, брать себя в таргет при входе в Rest и MoveToSpot
|
||||
if (worldHandler.Hero.Target != null && (worldHandler.Hero.AttackerIds.Contains(worldHandler.Hero.Target.Id) || worldHandler.Hero.Target.VitalStats.IsDead))
|
||||
{
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user