Some manual TryGetComponent inlines
This commit is contained in:
@@ -2,6 +2,7 @@ using Content.Shared.Atmos.Piping;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.Atmos.Visualizers
|
||||
@@ -13,7 +14,7 @@ namespace Content.Client.Atmos.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!component.Owner.TryGetComponent(out SpriteComponent? sprite))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
if (component.TryGetData(PipeColorVisuals.Color, out Color color))
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Content.Client.Storage
|
||||
{
|
||||
var controlledEntity = IoCManager.Resolve<IPlayerManager>().LocalPlayer?.ControlledEntity;
|
||||
|
||||
if (controlledEntity?.TryGetComponent(out HandsComponent? hands) ?? false)
|
||||
if (controlledEntity != null && controlledEntity.TryGetComponent(out HandsComponent? hands))
|
||||
{
|
||||
#pragma warning disable 618
|
||||
StorageEntity.SendNetworkMessage(new InsertEntityMessage());
|
||||
|
||||
Reference in New Issue
Block a user