diff --git a/Content.Shared/Physics/Controllers/SharedConveyorController.cs b/Content.Shared/Physics/Controllers/SharedConveyorController.cs index e8b22b410c6..74b1a5026dc 100644 --- a/Content.Shared/Physics/Controllers/SharedConveyorController.cs +++ b/Content.Shared/Physics/Controllers/SharedConveyorController.cs @@ -4,6 +4,7 @@ using Content.Shared.Gravity; using Content.Shared.Movement.Components; using Content.Shared.Movement.Events; using Content.Shared.Movement.Systems; +using Content.Shared.Stacks; using Robust.Shared.Collections; using Robust.Shared.Map; using Robust.Shared.Physics; @@ -24,6 +25,7 @@ public abstract class SharedConveyorController : VirtualController [Dependency] private readonly FixtureSystem _fixtures = default!; [Dependency] private readonly SharedGravitySystem _gravity = default!; [Dependency] private readonly SharedMoverController _mover = default!; + [Dependency] private readonly SharedStackSystem _stack = default!; protected const string ConveyorFixture = "conveyor"; @@ -164,7 +166,15 @@ public abstract class SharedConveyorController : VirtualController if (ent.Result) { - SetConveying(ent.Entity.Owner, ent.Entity.Comp1, targetDir.LengthSquared() > 0f); + if (targetDir.LengthSquared() > 0f) + { + SetConveying(ent.Entity.Owner, ent.Entity.Comp1, true); + } + else if (ent.Entity.Comp1.Conveying) + { + SetConveying(ent.Entity.Owner, ent.Entity.Comp1, false); + _stack.TryMergeToContacts(ent.Entity.Owner); + } // We apply friction here so when we push items towards the center of the conveyor they don't go overspeed. // We also don't want this to apply to mobs as they apply their own friction and otherwise