mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
Uses the following Cherry-Picks: https://github.com/space-wizards/space-station-14/pull/26994 https://github.com/space-wizards/space-station-14/pull/26518 https://github.com/space-wizards/space-station-14/pull/26279 https://github.com/space-wizards/space-station-14/pull/24946 https://github.com/space-wizards/space-station-14/pull/27188 Requires: https://github.com/Simple-Station/Einstein-Engines/pull/535 https://github.com/Simple-Station/Einstein-Engines/pull/534 --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Co-authored-by: Jake Huxell <JakeHuxell@pm.me> Co-authored-by: Tayrtahn <tayrtahn@gmail.com> Co-authored-by: 0x6273 <0x40@keemail.me> Co-authored-by: DEATHB4DEFEAT <zachcaffee@outlook.com>
51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using Content.Server.Administration;
|
|
using Content.Shared.Administration;
|
|
using Robust.Shared.Console;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Map.Components;
|
|
using SQLitePCL;
|
|
|
|
namespace Content.Server.Decals.Commands
|
|
{
|
|
[AdminCommand(AdminFlags.Mapping)]
|
|
public sealed class RemoveDecalCommand : IConsoleCommand
|
|
{
|
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
|
|
|
public string Command => "rmdecal";
|
|
public string Description => "removes a decal";
|
|
public string Help => $"{Command} <uid> <gridId>";
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
if (args.Length != 2)
|
|
{
|
|
shell.WriteError($"Unexpected number of arguments.\nExpected two: {Help}");
|
|
return;
|
|
}
|
|
|
|
if (!uint.TryParse(args[0], out var uid))
|
|
{
|
|
shell.WriteError($"Failed parsing uid.");
|
|
return;
|
|
}
|
|
|
|
if (!NetEntity.TryParse(args[1], out var rawGridIdNet) ||
|
|
!_entManager.TryGetEntity(rawGridIdNet, out var rawGridId) ||
|
|
!_entManager.HasComponent<MapGridComponent>(rawGridId))
|
|
{
|
|
shell.WriteError("Failed parsing gridId.");
|
|
return;
|
|
}
|
|
|
|
var decalSystem = _entManager.System<DecalSystem>();
|
|
if (decalSystem.RemoveDecal(rawGridId.Value, uid))
|
|
{
|
|
shell.WriteLine($"Successfully removed decal {uid}.");
|
|
return;
|
|
}
|
|
|
|
shell.WriteError($"Failed trying to remove decal {uid}.");
|
|
}
|
|
}
|
|
}
|