]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Admin spring cleaning (#36190)
authorJ <billsmith116@gmail.com>
Mon, 14 Apr 2025 04:06:36 +0000 (04:06 +0000)
committerGitHub <noreply@github.com>
Mon, 14 Apr 2025 04:06:36 +0000 (14:06 +1000)
* Cleanup warnings in administration

* Job command cleanup

* Reverting already implemented changes

Content.Server/Administration/Commands/AGhostCommand.cs
Content.Server/Administration/Commands/ForceGhostCommand.cs
Content.Server/Administration/Logs/Converters/EntityCoordinatesConverter.cs
Content.Server/Administration/Managers/AdminManager.cs
Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Content.Server/Administration/Toolshed/TagCommand.cs
Content.Server/Station/Commands/JobsCommand.cs

index b24dbbc018c58fa2ed4f0bac1ac3b55fc09358f5..6acaadbf838cc4f1c43c55d445396693c18dc2b1 100644 (file)
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
 using Content.Server.GameTicking;
 using Content.Server.Ghost;
 using Content.Server.Mind;
index 68a77b74549da239b960a05b4d0415e2185086d5..aed31028822b57cabbfa6fe55c0f5bf546bdf61b 100644 (file)
@@ -11,7 +11,6 @@ namespace Content.Server.Administration.Commands;
 [AdminCommand(AdminFlags.Admin)]
 public sealed class ForceGhostCommand : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntityManager _entityManager = default!;
     [Dependency] private readonly IPlayerManager _playerManager = default!;
     [Dependency] private readonly GameTicker _gameTicker = default!;
     [Dependency] private readonly SharedMindSystem _mind = default!;
index 3de5d98a81a8e69296acba88b529e2dacf95d689..fb5c6a6fe54d82de654b383dc5fd2a981c43645e 100644 (file)
@@ -1,4 +1,4 @@
-using System.Text.Json;
+using System.Text.Json;
 using Content.Shared.Station.Components;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -72,6 +72,6 @@ public readonly struct SerializableEntityCoordinates
         EntityUid = coordinates.EntityId;
         X = coordinates.X;
         Y = coordinates.Y;
-        MapUid = coordinates.GetMapUid(entityManager);
+        MapUid = entityManager.System<SharedTransformSystem>().GetMap(coordinates);
     }
 }
index 05dacdc577a3200f075481766cb489ff511195e3..59fc11f7bbc000f5a0ded83b33b9cc6c0e8dedde 100644 (file)
@@ -4,10 +4,8 @@ using System.Reflection;
 using System.Threading.Tasks;
 using Content.Server.Chat.Managers;
 using Content.Server.Database;
-using Content.Server.Players;
 using Content.Shared.Administration;
 using Content.Shared.CCVar;
-using Content.Shared.Info;
 using Content.Shared.Players;
 using Robust.Server.Console;
 using Robust.Server.Player;
@@ -108,7 +106,7 @@ namespace Content.Server.Administration.Managers
                 // The DB function handles this scenario fine, but it's worth noting.
                 await _dbManager.UpdateAdminDeadminnedAsync(player.UserId, newState);
             }
-            catch (Exception e)
+            catch (Exception)
             {
                 _sawmill.Error("Failed to save deadmin state to database for {Admin}", player.UserId);
             }
index 027a39dd5dac964cd6186bd389c2cdc5d407db2c..114ab943ea8d4abd2263b2a4804927ab48e8c7ba 100644 (file)
@@ -421,7 +421,7 @@ public sealed partial class AdminVerbSystem
                 {
                     var xform = Transform(args.Target);
                     var fixtures = Comp<FixturesComponent>(args.Target);
-                    _transformSystem.Unanchor(args.Target); // Just in case.
+                    _transformSystem.Unanchor(args.Target, xform); // Just in case.
                     _physics.SetBodyType(args.Target, BodyType.Dynamic, manager: fixtures, body: physics);
                     _physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir);
                     _physics.WakeBody(args.Target, manager: fixtures, body: physics);
index a751b8591451b4f932c29354d9cef8848fbac469..119578f100965f4fd880ec71c36c00d77954bf90 100644 (file)
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
 using Content.Shared.Administration;
 using Content.Shared.Tag;
 using Robust.Shared.Prototypes;
@@ -29,10 +29,10 @@ public sealed class TagCommand : ToolshedCommand
     public IEnumerable<EntityUid> With(
         [CommandInvocationContext] IInvocationContext ctx,
         [PipedArgument] IEnumerable<EntityUid> entities,
-        [CommandArgument] ValueRef<string, Prototype<TagPrototype>> tag)
+        [CommandArgument] ProtoId<TagPrototype> tag)
     {
         _tag ??= GetSys<TagSystem>();
-        return entities.Where(e => _tag.HasTag(e, tag.Evaluate(ctx)!));
+        return entities.Where(e => _tag.HasTag(e, tag!));
     }
 
     [CommandImplementation("add")]
index 599a87aac6c3eff8fbea005d0d237268b859d853..c971a1cac3137cf77bb0450d57c1749ce7a581d7 100644 (file)
@@ -1,8 +1,9 @@
-using System.Linq;
+using System.Linq;
 using Content.Server.Administration;
 using Content.Server.Station.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Roles;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Toolshed;
 using Robust.Shared.Toolshed.Syntax;
 using Robust.Shared.Toolshed.TypeParsers;
@@ -30,15 +31,15 @@ public sealed class JobsCommand : ToolshedCommand
         => stations.SelectMany(Jobs);
 
     [CommandImplementation("job")]
-    public JobSlotRef Job([PipedArgument] EntityUid station, Prototype<JobPrototype> job)
+    public JobSlotRef Job([PipedArgument] EntityUid station, ProtoId<JobPrototype> job)
     {
         _jobs ??= GetSys<StationJobsSystem>();
 
-        return new JobSlotRef(job.Value.ID, station, _jobs, EntityManager);
+        return new JobSlotRef(job.Id, station, _jobs, EntityManager);
     }
 
     [CommandImplementation("job")]
-    public IEnumerable<JobSlotRef> Job([PipedArgument] IEnumerable<EntityUid> stations, Prototype<JobPrototype> job)
+    public IEnumerable<JobSlotRef> Job([PipedArgument] IEnumerable<EntityUid> stations, ProtoId<JobPrototype> job)
         => stations.Select(x => Job(x, job));
 
     [CommandImplementation("isinfinite")]