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

@@ -261,7 +261,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
if (!Resolve(stationUid, ref stationShuttle))
return;
if (!TryComp<TransformComponent>(stationShuttle.EmergencyShuttle, out var xform) ||
if (!TryComp(stationShuttle.EmergencyShuttle, out TransformComponent? xform) ||
!TryComp<ShuttleComponent>(stationShuttle.EmergencyShuttle, out var shuttle))
{
Log.Error($"Attempted to call an emergency shuttle for an uninitialized station? Station: {ToPrettyString(stationUid)}. Shuttle: {ToPrettyString(stationShuttle.EmergencyShuttle)}");
@@ -284,7 +284,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
if (_shuttle.TryFTLDock(stationShuttle.EmergencyShuttle.Value, shuttle, targetGrid.Value, DockTag))
{
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
if (TryComp(targetGrid.Value, out TransformComponent? targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
_chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-docked", ("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())), playDefaultSound: false);
@@ -330,7 +330,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
return;
// Post mapinit? fancy
if (TryComp<TransformComponent>(component.Entity, out var xform))
if (TryComp(component.Entity, out TransformComponent? xform))
{
component.MapEntity = xform.MapUid;
return;