Use non-generic TryComp() for metadata & transform (#28133)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user