]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix inspect mind verb (#36558)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Mon, 14 Apr 2025 14:45:57 +0000 (16:45 +0200)
committerGitHub <noreply@github.com>
Mon, 14 Apr 2025 14:45:57 +0000 (16:45 +0200)
Content.Client/Administration/Systems/AdminVerbSystem.cs
Content.Server/Administration/Systems/AdminVerbSystem.cs

index 4ced299a4dcab189ab1e6a2cac5c77ce5d4f4bac..1e15186706cf966e600c373401a9eca4fa18b5d0 100644 (file)
@@ -37,21 +37,6 @@ namespace Content.Client.Administration.Systems
                     ClientExclusive = true // opening VV window is client-side. Don't ask server to run this verb.
                 };
                 args.Verbs.Add(verb);
-
-                // Inspect mind
-                if (TryComp<MindContainerComponent>(args.Target, out var mindContainer)
-                    && mindContainer.HasMind)
-                {
-                    Verb mindVerb = new()
-                    {
-                        Text = Loc.GetString("inspect-mind-verb-get-data-text"),
-                        Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/sentient.svg.192dpi.png")),
-                        Category = VerbCategory.Debug,
-                        Act = () => _clientConsoleHost.ExecuteCommand($"vv {GetNetEntity(mindContainer.Mind)}"),
-                        ClientExclusive = true
-                    };
-                    args.Verbs.Add(mindVerb);
-                }
             }
 
             if (!_admin.IsAdmin(args.User))
index d10ffe2942b1979d231add91285964cda83b8dc6..c8f19aadbe09100781ce1df4924e6d293860bad4 100644 (file)
@@ -194,7 +194,7 @@ namespace Content.Server.Administration.Systems
                     });
                 }
 
-                if (_mindSystem.TryGetMind(args.Target, out _, out var mind) && mind.UserId != null)
+                if (_mindSystem.TryGetMind(args.Target, out var mindId, out var mindComp) && mindComp.UserId != null)
                 {
                     // Erase
                     args.Verbs.Add(new Verb
@@ -206,7 +206,7 @@ namespace Content.Server.Administration.Systems
                             new("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png")),
                         Act = () =>
                         {
-                            _adminSystem.Erase(mind.UserId.Value);
+                            _adminSystem.Erase(mindComp.UserId.Value);
                         },
                         Impact = LogImpact.Extreme,
                         ConfirmationPopup = true
@@ -219,11 +219,20 @@ namespace Content.Server.Administration.Systems
                         Category = VerbCategory.Admin,
                         Act = () =>
                         {
-                            _console.ExecuteCommand(player, $"respawn \"{mind.UserId}\"");
+                            _console.ExecuteCommand(player, $"respawn \"{mindComp.UserId}\"");
                         },
                         ConfirmationPopup = true,
                         // No logimpact as the command does it internally.
                     });
+
+                    // Inspect mind
+                    args.Verbs.Add(new Verb
+                    {
+                        Text = Loc.GetString("inspect-mind-verb-get-data-text"),
+                        Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/sentient.svg.192dpi.png")),
+                        Category = VerbCategory.Debug,
+                        Act = () => _console.RemoteExecuteCommand(player, $"vv {GetNetEntity(mindId)}"),
+                    });
                 }
 
                 // Freeze