Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -2,12 +2,16 @@ using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Map;
using SQLitePCL;
namespace Content.Server.Decals.Commands
{
[AdminCommand(AdminFlags.Mapping)]
public sealed class RemoveDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
public string Command => "rmdecal";
public string Description => "removes a decal";
public string Help => $"{Command} <uid> <gridId>";
@@ -25,14 +29,16 @@ namespace Content.Server.Decals.Commands
return;
}
if (!EntityUid.TryParse(args[1], out var rawGridId) ||
!IoCManager.Resolve<IMapManager>().GridExists(rawGridId))
if (!NetEntity.TryParse(args[1], out var rawGridIdNet) ||
!_entManager.TryGetEntity(rawGridIdNet, out var rawGridId) ||
!_mapManager.GridExists(rawGridId))
{
shell.WriteError("Failed parsing gridId.");
return;
}
var decalSystem = EntitySystem.Get<DecalSystem>();
if (decalSystem.RemoveDecal(rawGridId, uid))
var decalSystem = _entManager.System<DecalSystem>();
if (decalSystem.RemoveDecal(rawGridId.Value, uid))
{
shell.WriteLine($"Successfully removed decal {uid}.");
return;