Use non-generic TryComp() for metadata & transform (#28133)
This commit is contained in:
@@ -16,7 +16,7 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
private void OnIFFShow(EntityUid uid, IFFConsoleComponent component, IFFShowIFFMessage args)
|
||||
{
|
||||
if (!TryComp<TransformComponent>(uid, out var xform) || xform.GridUid == null ||
|
||||
if (!TryComp(uid, out TransformComponent? xform) || xform.GridUid == null ||
|
||||
(component.AllowedFlags & IFFFlags.HideLabel) == 0x0)
|
||||
{
|
||||
return;
|
||||
@@ -34,7 +34,7 @@ public sealed partial class ShuttleSystem
|
||||
|
||||
private void OnIFFShowVessel(EntityUid uid, IFFConsoleComponent component, IFFShowVesselMessage args)
|
||||
{
|
||||
if (!TryComp<TransformComponent>(uid, out var xform) || xform.GridUid == null ||
|
||||
if (!TryComp(uid, out TransformComponent? xform) || xform.GridUid == null ||
|
||||
(component.AllowedFlags & IFFFlags.Hide) == 0x0)
|
||||
{
|
||||
return;
|
||||
@@ -54,7 +54,7 @@ public sealed partial class ShuttleSystem
|
||||
{
|
||||
// If we anchor / re-anchor then make sure flags up to date.
|
||||
if (!args.Anchored ||
|
||||
!TryComp<TransformComponent>(uid, out var xform) ||
|
||||
!TryComp(uid, out TransformComponent? xform) ||
|
||||
!TryComp<IFFComponent>(xform.GridUid, out var iff))
|
||||
{
|
||||
_uiSystem.SetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
|
||||
|
||||
Reference in New Issue
Block a user