Fix warnings in ShuttleSystem.GridFill.cs (#30253)

* Fix warnings in ShuttleSystem.GridFill.cs

* remove the thingie

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Simon
2024-08-05 06:09:42 +02:00
committed by GitHub
parent 68dbf6449c
commit 0ef5f668e2
2 changed files with 8 additions and 9 deletions

View File

@@ -2,9 +2,7 @@ using System.Numerics;
using Content.Server.Shuttles.Components;
using Content.Server.Station.Components;
using Content.Server.Station.Events;
using Content.Shared.Cargo.Components;
using Content.Shared.CCVar;
using Content.Shared.Procedural;
using Content.Shared.Salvage;
using Content.Shared.Shuttles.Components;
using Content.Shared.Station.Components;
@@ -72,11 +70,11 @@ public sealed partial class ShuttleSystem
if (targetGrid == null)
return;
var mapId = _mapManager.CreateMap();
_mapSystem.CreateMap(out var mapId);
if (_loader.TryLoad(mapId, component.Path.ToString(), out var ent) && ent.Count > 0)
{
if (TryComp<ShuttleComponent>(ent[0], out var shuttle))
if (HasComp<ShuttleComponent>(ent[0]))
{
TryFTLProximity(ent[0], targetGrid.Value);
}
@@ -87,7 +85,7 @@ public sealed partial class ShuttleSystem
_mapManager.DeleteMap(mapId);
}
private bool TryDungeonSpawn(Entity<MapGridComponent?> targetGrid, EntityUid stationUid, MapId mapId, DungeonSpawnGroup group, out EntityUid spawned)
private bool TryDungeonSpawn(Entity<MapGridComponent?> targetGrid, MapId mapId, DungeonSpawnGroup group, out EntityUid spawned)
{
spawned = EntityUid.Invalid;
@@ -146,7 +144,7 @@ public sealed partial class ShuttleSystem
if (_loader.TryLoad(mapId, path.ToString(), out var ent) && ent.Count == 1)
{
if (TryComp<ShuttleComponent>(ent[0], out var shuttle))
if (HasComp<ShuttleComponent>(ent[0]))
{
TryFTLProximity(ent[0], targetGrid);
}
@@ -181,7 +179,7 @@ public sealed partial class ShuttleSystem
return;
// Spawn on a dummy map and try to FTL if possible, otherwise dump it.
var mapId = _mapManager.CreateMap();
_mapSystem.CreateMap(out var mapId);
foreach (var group in component.Groups.Values)
{
@@ -194,7 +192,7 @@ public sealed partial class ShuttleSystem
switch (group)
{
case DungeonSpawnGroup dungeon:
if (!TryDungeonSpawn(targetGrid.Value, uid, mapId, dungeon, out spawned))
if (!TryDungeonSpawn(targetGrid.Value, mapId, dungeon, out spawned))
continue;
break;
@@ -244,7 +242,7 @@ public sealed partial class ShuttleSystem
}
// Spawn on a dummy map and try to dock if possible, otherwise dump it.
var mapId = _mapManager.CreateMap();
_mapSystem.CreateMap(out var mapId);
var valid = false;
if (_loader.TryLoad(mapId, component.Path.ToString(), out var ent) &&