ECS and cleanup body system, merge body templates and presets into body prototypes (#11991)
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Body.Components;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands
|
||||
@@ -27,15 +26,11 @@ namespace Content.Server.Administration.Commands
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var bodySystem = entityManager.System<BodySystem>();
|
||||
|
||||
if (!entityManager.TryGetComponent<TransformComponent>(entityUid, out var transform)) return;
|
||||
|
||||
var parent = transform.ParentUid;
|
||||
|
||||
if (entityManager.TryGetComponent<BodyPartComponent>(parent, out var body) &&
|
||||
entityManager.TryGetComponent<MechanismComponent>(entityUid, out var part))
|
||||
if (bodySystem.DropOrgan(entityUid))
|
||||
{
|
||||
body.RemoveMechanism(part);
|
||||
shell.WriteLine($"Removed organ {entityManager.ToPrettyString(entityUid)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user