]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Command resolves (#38415)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Tue, 17 Jun 2025 23:40:33 +0000 (19:40 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 23:40:33 +0000 (01:40 +0200)
touchups

Content.Server/Radiation/Systems/RadiationSystem.Debug.cs
Content.Server/Sandbox/Commands/ColorNetworkCommand.cs
Content.Server/Voting/VoteCommands.cs

index f2eac9be6c1ab0f6e7fa4b1c593778c4140fb5c7..7e1775e35911a0874992b50b7548f664e369c46c 100644 (file)
@@ -1,11 +1,9 @@
-using System.Linq;
 using Content.Server.Administration;
 using Content.Server.Radiation.Components;
 using Content.Shared.Administration;
 using Content.Shared.Radiation.Events;
 using Content.Shared.Radiation.Systems;
 using Robust.Shared.Console;
-using Robust.Shared.Debugging;
 using Robust.Shared.Enums;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Player;
index 2fcfcd8cbbf3e83beb38cfb80e64b9b3bd0d78cb..9f4d617904596658115a412cf0736e14fb7e471a 100644 (file)
@@ -11,17 +11,17 @@ using Robust.Shared.Console;
 namespace Content.Server.Sandbox.Commands
 {
     [AnyCommand]
-    public sealed class ColorNetworkCommand : LocalizedCommands
+    public sealed class ColorNetworkCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _entManager = default!;
+        [Dependency] private readonly IAdminManager _adminManager = default!;
+        [Dependency] private readonly AtmosPipeColorSystem _pipeColorSystem = default!;
+        [Dependency] private readonly SandboxSystem _sandboxSystem = default!;
 
         public override string Command => "colornetwork";
 
         public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var sandboxManager = _entManager.System<SandboxSystem>();
-            var adminManager = IoCManager.Resolve<IAdminManager>();
-            if (shell.IsClient || (!sandboxManager.IsSandboxEnabled && !adminManager.HasAdminFlag(shell.Player!, AdminFlags.Mapping)))
+            if (shell.IsClient || (!_sandboxSystem.IsSandboxEnabled && !_adminManager.HasAdminFlag(shell.Player!, AdminFlags.Mapping)))
             {
                 shell.WriteError(Loc.GetString("cmd-colornetwork-no-access"));
             }
@@ -40,13 +40,13 @@ namespace Content.Server.Sandbox.Commands
 
             var nent = new NetEntity(targetId);
 
-            if (!_entManager.TryGetEntity(nent, out var eUid))
+            if (!EntityManager.TryGetEntity(nent, out var eUid))
             {
                 shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
                 return;
             }
 
-            if (!_entManager.TryGetComponent(eUid, out NodeContainerComponent? nodeContainerComponent))
+            if (!EntityManager.TryGetComponent(eUid, out NodeContainerComponent? nodeContainerComponent))
             {
                 shell.WriteLine(Loc.GetString("shell-entity-is-not-node-container"));
                 return;
@@ -77,10 +77,10 @@ namespace Content.Server.Sandbox.Commands
 
             foreach (var x in group.Nodes)
             {
-                if (!_entManager.TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent))
+                if (!EntityManager.TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent))
                     continue;
 
-                _entManager.System<AtmosPipeColorSystem>().SetColor(x.Owner, atmosPipeColorComponent, color);
+                _pipeColorSystem.SetColor(x.Owner, atmosPipeColorComponent, color);
             }
         }
     }
index e7b85998553fda320609ad2c3a4b38803016d8ed..677fe1d0f6e188d766b0d9bb6d39a4df940ad54f 100644 (file)
@@ -249,10 +249,9 @@ namespace Content.Server.Voting
 
         public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
-            var mgr = IoCManager.Resolve<IVoteManager>();
             if (args.Length == 1)
             {
-                var options = mgr.ActiveVotes
+                var options = _voteManager.ActiveVotes
                     .OrderBy(v => v.Id)
                     .Select(v => new CompletionOption(v.Id.ToString(), v.Title));