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.Shuttles.Components;
using Content.Server.Station.Components; using Content.Server.Station.Components;
using Content.Server.Station.Events; using Content.Server.Station.Events;
using Content.Shared.Cargo.Components;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Procedural;
using Content.Shared.Salvage; using Content.Shared.Salvage;
using Content.Shared.Shuttles.Components; using Content.Shared.Shuttles.Components;
using Content.Shared.Station.Components; using Content.Shared.Station.Components;
@@ -72,11 +70,11 @@ public sealed partial class ShuttleSystem
if (targetGrid == null) if (targetGrid == null)
return; return;
var mapId = _mapManager.CreateMap(); _mapSystem.CreateMap(out var mapId);
if (_loader.TryLoad(mapId, component.Path.ToString(), out var ent) && ent.Count > 0) 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); TryFTLProximity(ent[0], targetGrid.Value);
} }
@@ -87,7 +85,7 @@ public sealed partial class ShuttleSystem
_mapManager.DeleteMap(mapId); _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; 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 (_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); TryFTLProximity(ent[0], targetGrid);
} }
@@ -181,7 +179,7 @@ public sealed partial class ShuttleSystem
return; return;
// Spawn on a dummy map and try to FTL if possible, otherwise dump it. // 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) foreach (var group in component.Groups.Values)
{ {
@@ -194,7 +192,7 @@ public sealed partial class ShuttleSystem
switch (group) switch (group)
{ {
case DungeonSpawnGroup dungeon: case DungeonSpawnGroup dungeon:
if (!TryDungeonSpawn(targetGrid.Value, uid, mapId, dungeon, out spawned)) if (!TryDungeonSpawn(targetGrid.Value, mapId, dungeon, out spawned))
continue; continue;
break; break;
@@ -244,7 +242,7 @@ public sealed partial class ShuttleSystem
} }
// Spawn on a dummy map and try to dock if possible, otherwise dump it. // 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; var valid = false;
if (_loader.TryLoad(mapId, component.Path.ToString(), out var ent) && if (_loader.TryLoad(mapId, component.Path.ToString(), out var ent) &&

View File

@@ -34,6 +34,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
[Dependency] private readonly IComponentFactory _factory = default!; [Dependency] private readonly IComponentFactory _factory = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;