Inline TryGetComponent completely, for real
This commit is contained in:
@@ -3,6 +3,8 @@ using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Storage.EntitySystems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Storage.EntitySystems
|
||||
{
|
||||
@@ -11,7 +13,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
{
|
||||
protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
|
||||
{
|
||||
if (!msg.Container.Owner.TryGetComponent(out ServerStorageComponent? component)
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(msg.Container.Owner.Uid, out ServerStorageComponent? component)
|
||||
|| component.StoredEntities == null)
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user