Use non-generic TryComp() for metadata & transform (#28133)

This commit is contained in:
Leon Friedrich
2024-05-21 17:40:35 +12:00
committed by GitHub
parent 3b61368946
commit 0f6e1196d8
38 changed files with 65 additions and 65 deletions

View File

@@ -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()