Refactor standing to be ECS (#4142)

* Refactor standing to be ECS

E C S B A B Y

* DONE

* FIX IT FIX IT FIX IT

* IsDown event

* Change to methods

* Fixes

* Address some reviews

* Last of the Mohicans

* Final fixes

* Fix tests
This commit is contained in:
metalgearsloth
2021-06-27 19:02:46 +10:00
committed by GitHub
parent 97f4f0a9bd
commit 50cc526ebd
30 changed files with 328 additions and 268 deletions

View File

@@ -3,15 +3,14 @@ using System.Threading.Tasks;
using Content.Server.Hands.Components;
using Content.Server.Items;
using Content.Server.Paper;
using Content.Server.Standing;
using Content.Server.Storage.Components;
using Content.Shared.ActionBlocker;
using Content.Shared.Body.Components;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Morgue;
using Content.Shared.Notification.Managers;
using Content.Shared.Standing;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
@@ -39,7 +38,7 @@ namespace Content.Server.Morgue.Components
{
base.Initialize();
_appearance?.SetData(BodyBagVisuals.Label, false);
LabelContainer = ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, "body_bag_label", out _);
LabelContainer = Owner.EnsureContainer<ContainerSlot>("body_bag_label", out _);
}
protected override bool AddToContents(IEntity entity)

View File

@@ -131,11 +131,11 @@ namespace Content.Server.Morgue.Components
}
victim.PopupMessageOtherClients(Loc.GetString("crematorium-entity-storage-component-suicide-message-others", ("victim", victim)));
EntitySystem.Get<SharedStandingStateSystem>().Down(victim, false, false, true);
if (CanInsert(victim))
{
Insert(victim);
EntitySystem.Get<StandingStateSystem>().Down(victim, false);
}
else
{

View File

@@ -1,5 +1,4 @@
#nullable enable
using Content.Server.Standing;
using Content.Server.Storage.Components;
using Content.Shared.Body.Components;
using Content.Shared.Directions;
@@ -9,6 +8,7 @@ using Content.Shared.Interaction.Helpers;
using Content.Shared.Morgue;
using Content.Shared.Notification.Managers;
using Content.Shared.Physics;
using Content.Shared.Standing;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
@@ -51,7 +51,7 @@ namespace Content.Server.Morgue.Components
{
base.Initialize();
Appearance?.SetData(MorgueVisuals.Open, false);
TrayContainer = ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, "morgue_tray", out _);
TrayContainer = Owner.EnsureContainer<ContainerSlot>("morgue_tray", out _);
}
public override Vector2 ContentsDumpPosition()