Refactoring body system to use containers and general body cleanup (#20202)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Body.Part;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands
|
||||
@@ -11,7 +12,7 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
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>";
|
||||
public string Help => "Usage: addbodypart <entity uid> <body uid> <part slot> <part type>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
@@ -37,7 +38,10 @@ namespace Content.Server.Administration.Commands
|
||||
var parentId = _entManager.GetEntity(parentNetId);
|
||||
var bodySystem = _entManager.System<BodySystem>();
|
||||
|
||||
if (bodySystem.TryCreatePartSlotAndAttach(parentId, args[2], childId))
|
||||
|
||||
|
||||
if (Enum.TryParse<BodyPartType>(args[3], out var partType) &&
|
||||
bodySystem.TryCreatePartSlotAndAttach(parentId, args[2], childId, partType))
|
||||
{
|
||||
shell.WriteLine($@"Added {childId} to {parentId}.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user