hands ECS (#7081)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user