Inline TryGetComponent completely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:05:23 +01:00
parent f3edecf994
commit 2ff4ec65d5
34 changed files with 98 additions and 84 deletions

View File

@@ -4,6 +4,7 @@ using Content.Shared.Storage.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
@@ -19,7 +20,7 @@ namespace Content.Client.Storage.Visualizers
{
base.InitializeEntity(entity);
if (entity.TryGetComponent<ISpriteComponent>(out var spriteComponent))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ISpriteComponent?>(entity.Uid, out var spriteComponent))
{
_rsiPath ??= spriteComponent.BaseRSI!.Path!;
}