]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix warnings in ShuttleSystem.GridFill.cs (#30253)
authorSimon <63975668+Simyon264@users.noreply.github.com>
Mon, 5 Aug 2024 04:09:42 +0000 (06:09 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Aug 2024 04:09:42 +0000 (14:09 +1000)
* Fix warnings in ShuttleSystem.GridFill.cs

* remove the thingie

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
Content.Server/Shuttles/Systems/ShuttleSystem.cs

index a31fda074f3621a183975497bbfdff03f85c135c..c0eff119314c14985b33157d5629ec3367affbb9 100644 (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) &&
index aae466ba0dccbd4c4281fe18261750ffa1103f83..6ae4aff2f4a4f09fa64177e89ceed4d5581ac834 100644 (file)
@@ -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!;