From 0ef5f668e27ffaa0deb4db1e1232b8f524a58639 Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Mon, 5 Aug 2024 06:09:42 +0200 Subject: [PATCH] Fix warnings in ShuttleSystem.GridFill.cs (#30253) * Fix warnings in ShuttleSystem.GridFill.cs * remove the thingie --------- Co-authored-by: metalgearsloth --- .../Shuttles/Systems/ShuttleSystem.GridFill.cs | 16 +++++++--------- Content.Server/Shuttles/Systems/ShuttleSystem.cs | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs index a31fda074f..c0eff11931 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs @@ -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(ent[0], out var shuttle)) + if (HasComp(ent[0])) { TryFTLProximity(ent[0], targetGrid.Value); } @@ -87,7 +85,7 @@ public sealed partial class ShuttleSystem _mapManager.DeleteMap(mapId); } - private bool TryDungeonSpawn(Entity targetGrid, EntityUid stationUid, MapId mapId, DungeonSpawnGroup group, out EntityUid spawned) + private bool TryDungeonSpawn(Entity 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(ent[0], out var shuttle)) + if (HasComp(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) && diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index aae466ba0d..6ae4aff2f4 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -34,6 +34,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem [Dependency] private readonly IComponentFactory _factory = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly MapSystem _mapSystem = default!; [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly IRobustRandom _random = default!;