Sending a mob out of a disposals unit shouldn't push them into a wall anymore (#5411)

* Sending a mob out of a disposals unit shouldn't push them into a wall anymore.

* Something something resolves vs. OnRemove fighting it out

* Disposals yeet reduction: Address reviews and other oddities
This commit is contained in:
20kdc
2021-11-23 23:38:46 +00:00
committed by GitHub
parent 0e98c1c524
commit eb18f7bc1c
5 changed files with 182 additions and 162 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Linq;
using Content.Server.Construction.Components;
using Content.Server.Disposal.Unit.Components;
using Content.Server.Disposal.Unit.EntitySystems;
using Content.Shared.Acts;
using Content.Shared.Disposal.Components;
using Content.Shared.Popups;
@@ -48,34 +49,6 @@ namespace Content.Server.Disposal.Tube.Components
public abstract Direction NextDirection(DisposalHolderComponent holder);
public virtual Vector2 ExitVector(DisposalHolderComponent holder)
{
return NextDirection(holder).ToVec();
}
public bool Remove(DisposalHolderComponent holder)
{
var removed = Contents.Remove(holder.Owner);
holder.ExitDisposals();
return removed;
}
public bool TransferTo(DisposalHolderComponent holder, IDisposalTubeComponent to)
{
var position = holder.Owner.Transform.LocalPosition;
if (!to.Contents.Insert(holder.Owner))
{
return false;
}
holder.Owner.Transform.LocalPosition = position;
Contents.Remove(holder.Owner);
holder.EnterTube(to);
return true;
}
// TODO: Make disposal pipes extend the grid
private void Connect()
{
@@ -123,7 +96,7 @@ namespace Content.Server.Disposal.Tube.Components
continue;
}
holder.ExitDisposals();
EntitySystem.Get<DisposableSystem>().ExitDisposals(holder.OwnerUid);
}
}