Fix griddrag and tethergun (#10510)
This commit is contained in:
33
Content.Server/Maps/GridDraggingCommand.cs
Normal file
33
Content.Server/Maps/GridDraggingCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Maps;
|
||||
|
||||
/// <summary>
|
||||
/// Toggles GridDragging on the system.
|
||||
/// </summary>
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class GridDraggingCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => SharedGridDraggingSystem.CommandName;
|
||||
public string Description => $"Allows someone with permissions to drag grids around.";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (shell.Player == null)
|
||||
{
|
||||
shell.WriteError("shell-server-cannot");
|
||||
return;
|
||||
}
|
||||
|
||||
var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GridDraggingSystem>();
|
||||
system.Toggle(shell.Player);
|
||||
|
||||
if (system.IsEnabled(shell.Player))
|
||||
shell.WriteLine("Grid dragging toggled on");
|
||||
else
|
||||
shell.WriteLine("Grid dragging toggled off");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user