Content update for NetEntities (#18935)
This commit is contained in:
@@ -7,6 +7,8 @@ namespace Content.Server.Administration.Commands
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public sealed class AddBodyPartCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
public string Command => "addbodypart";
|
||||
public string Description => "Adds a given entity to a containing body.";
|
||||
public string Help => "Usage: addbodypart <entity uid> <body uid> <part slot>";
|
||||
@@ -19,20 +21,21 @@ namespace Content.Server.Administration.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EntityUid.TryParse(args[0], out var childId))
|
||||
if (!NetEntity.TryParse(args[0], out var childNetId))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("shell-entity-uid-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EntityUid.TryParse(args[1], out var parentId))
|
||||
if (!NetEntity.TryParse(args[1], out var parentNetId))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("shell-entity-uid-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var bodySystem = entityManager.System<BodySystem>();
|
||||
var childId = _entManager.GetEntity(childNetId);
|
||||
var parentId = _entManager.GetEntity(parentNetId);
|
||||
var bodySystem = _entManager.System<BodySystem>();
|
||||
|
||||
if (bodySystem.TryCreatePartSlotAndAttach(parentId, args[2], childId))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user