mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
Make conveyors stack items that stop (#42829)
* Initial commit * formatting --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user