From ac588ab15c07d0061acc281b1cbb7edab271f9f3 Mon Sep 17 00:00:00 2001 From: Mervill Date: Tue, 22 Nov 2022 23:38:39 -0800 Subject: [PATCH] Conveyor belt fix (#12713) Fixes https://github.com/space-wizards/space-station-14/issues/12704 --- .../Unit/EntitySystems/DisposableSystem.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs index 653e90d7f1..6f6df0c7ff 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs @@ -7,6 +7,8 @@ using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; +using Robust.Shared.Physics.Components; namespace Content.Server.Disposal.Unit.EntitySystems { @@ -17,6 +19,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems [Dependency] private readonly DisposalUnitSystem _disposalUnitSystem = default!; [Dependency] private readonly DisposalTubeSystem _disposalTubeSystem = default!; [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; + [Dependency] private readonly SharedPhysicsSystem _physicsSystem = default!; public void ExitDisposals(EntityUid uid, DisposalHolderComponent? holder = null, TransformComponent? holderTransform = null) { @@ -50,13 +53,8 @@ namespace Content.Server.Disposal.Unit.EntitySystems { RemComp(entity); - if (EntityManager.TryGetComponent(entity, out IPhysBody? physics)) - { - physics.CanCollide = true; - } - var meta = MetaData(entity); - holder.Container.ForceRemove(entity, EntityManager, meta); + holder.Container.Remove(entity, EntityManager, meta: meta, reparent: false, force: true); var xform = Transform(entity); if (xform.ParentUid != uid) @@ -66,6 +64,11 @@ namespace Content.Server.Disposal.Unit.EntitySystems duc.Container.Insert(entity, EntityManager, xform, meta: meta); else xform.AttachToGridOrMap(); + + if (EntityManager.TryGetComponent(entity, out PhysicsComponent? physics)) + { + _physicsSystem.WakeBody(entity, physics); + } } if (duc != null) @@ -174,7 +177,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems // Past this point, we are performing inter-tube transfer! // Remove current tube content - currentTube.Contents.ForceRemove(holder.Owner); + currentTube.Contents.Remove(holder.Owner, reparent: false, force: true); // Find next tube var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.Owner, holder.CurrentDirection);