Files
tbd-station-14/Content.Server/AI/WorldState/States/Inventory/EquippedEntityState.cs
wrexbe cea1b21832 Fixing some warnings (#6250)
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
2022-01-21 10:38:35 +01:00

22 lines
608 B
C#

using Content.Server.Hands.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.AI.WorldState.States.Inventory
{
/// <summary>
/// AKA what's in active hand
/// </summary>
[UsedImplicitly]
public sealed class EquippedEntityState : StateData<EntityUid?>
{
public override string Name => "EquippedEntity";
public override EntityUid? GetValue()
{
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<HandsComponent>(Owner)?.GetActiveHandItem?.Owner;
}
}
}