Cleans up warnings in disposals (#17419)
This commit is contained in:
@@ -26,53 +26,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
/// Container of entities that are currently inside this tube
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public Container Contents { get; private set; } = default!;
|
||||
|
||||
// TODO: Make disposal pipes extend the grid
|
||||
// ???
|
||||
public void Connect()
|
||||
{
|
||||
if (Connected)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Connected = true;
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
if (!Connected)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Connected = false;
|
||||
|
||||
foreach (var entity in Contents.ContainedEntities.ToArray())
|
||||
{
|
||||
if (!_entMan.TryGetComponent(entity, out DisposalHolderComponent? holder))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
EntitySystem.Get<DisposableSystem>().ExitDisposals((holder).Owner);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
Contents = ContainerHelpers.EnsureContainer<Container>(Owner, ContainerId);
|
||||
Owner.EnsureComponent<AnchorableComponent>();
|
||||
}
|
||||
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
Disconnect();
|
||||
}
|
||||
[Access(typeof(DisposalTubeSystem), typeof(DisposableSystem))]
|
||||
public Container Contents { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user