This commit is contained in:
Leon Friedrich
2022-03-17 20:13:31 +13:00
committed by GitHub
parent 7b84362901
commit bfd95c493b
94 changed files with 1454 additions and 2185 deletions

View File

@@ -1,4 +1,5 @@
using Content.Server.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -16,19 +17,12 @@ namespace Content.Server.AI.Operators.Inventory
public override Outcome Execute(float frameTime)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(_owner, out HandsComponent? handsComponent))
{
return Outcome.Failed;
}
var sys = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<SharedHandsSystem>();
// TODO: If in clothing then click on it
foreach (var hand in handsComponent.ActivePriorityEnumerable())
{
if (handsComponent.GetItem(hand)?.Owner == _entity)
{
handsComponent.ActiveHand = hand;
return Outcome.Success;
}
}
if (sys.TrySelect(_owner, _entity))
return Outcome.Success;
// TODO: Get free hand count; if no hands free then fail right here