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:
DrSmugleaf
2022-10-23 00:46:28 +02:00
committed by GitHub
parent 9a38736c3c
commit f323fb7644
140 changed files with 2478 additions and 2571 deletions

View File

@@ -1,3 +1,4 @@
using Content.Server.Body.Systems;
using Content.Server.Buckle.Components;
using Content.Server.Buckle.Systems;
using Content.Server.Popups;
@@ -24,6 +25,7 @@ namespace Content.Server.Toilet
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SecretStashSystem _secretStash = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
@@ -48,8 +50,8 @@ namespace Content.Server.Toilet
return;
// Check that victim has a head
if (EntityManager.TryGetComponent<SharedBodyComponent>(args.Victim, out var body) &&
body.HasPartOfType(BodyPartType.Head))
if (EntityManager.TryGetComponent<BodyComponent>(args.Victim, out var body) &&
_bodySystem.BodyHasChildOfType(args.Victim, BodyPartType.Head, body))
{
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others",
("victim", Identity.Entity(args.Victim, EntityManager)), ("owner", uid));