Skip to content

Commit

Permalink
Fixed issues #328 (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
SDClowen authored Jul 25, 2022
1 parent 8bc7e43 commit 8ece2a5
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions Library/RSBot.Core/Components/PickupManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,29 @@ bool condition(SpawnedItem e)
return;
}

foreach (var item in entities.OrderBy(item => item.Movement.Source.DistanceTo(centerPosition))/*.Take(5)*/)
if (UseAbilityPet && Game.Player.HasActiveAbilityPet)
{
if (!Running)
return;
foreach (var item in entities.OrderBy(item => item.Movement.Source.DistanceTo(centerPosition))/*.Take(5)*/)
{
if (!Running)
return;

if (UseAbilityPet && Game.Player.HasActiveAbilityPet)
Game.Player.AbilityPet.Pickup(item.UniqueId);
else
item.Pickup();
}
}
else
{
var pickingItem = entities.OrderBy(item => item.Movement.Source.DistanceTo(centerPosition)).FirstOrDefault();
if(pickingItem == null)
{
Stop();
return;
}

pickingItem.Pickup();
}


}
catch (System.Exception e)
{
Expand Down

0 comments on commit 8ece2a5

Please sign in to comment.