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:
Jezithyr
2023-09-21 00:23:02 -07:00
committed by GitHub
parent d888d9ad67
commit 31b2c9f830
38 changed files with 1298 additions and 1098 deletions

View File

@@ -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}.");
}