Fixes disposals not flushing down humans.
- Also works around https://github.com/space-wizards/RobustToolbox/issues/1646
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Atmos;
|
using Content.Server.Atmos;
|
||||||
@@ -6,8 +7,10 @@ using Content.Server.GameObjects.Components.Items.Storage;
|
|||||||
using Content.Server.Interfaces;
|
using Content.Server.Interfaces;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.GameObjects.Components.Body;
|
using Content.Shared.GameObjects.Components.Body;
|
||||||
|
using Robust.Shared.Asynchronous;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
@@ -23,6 +26,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
{
|
{
|
||||||
public override string Name => "DisposalHolder";
|
public override string Name => "DisposalHolder";
|
||||||
|
|
||||||
|
private bool _deletionRequested = false;
|
||||||
private Container _contents = null!;
|
private Container _contents = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -77,12 +81,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entity.TryGetComponent(out IPhysBody? physics) ||
|
|
||||||
!physics.CanCollide)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return entity.HasComponent<ItemComponent>() ||
|
return entity.HasComponent<ItemComponent>() ||
|
||||||
entity.HasComponent<IBody>();
|
entity.HasComponent<IBody>();
|
||||||
}
|
}
|
||||||
@@ -118,6 +116,9 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
|
|
||||||
public void ExitDisposals()
|
public void ExitDisposals()
|
||||||
{
|
{
|
||||||
|
if (_deletionRequested || Deleted)
|
||||||
|
return;
|
||||||
|
|
||||||
PreviousTube = null;
|
PreviousTube = null;
|
||||||
CurrentTube = null;
|
CurrentTube = null;
|
||||||
NextTube = null;
|
NextTube = null;
|
||||||
@@ -146,8 +147,9 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
Air.Clear();
|
Air.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Deleted)
|
// FIXME: This is a workaround for https://github.com/space-wizards/RobustToolbox/issues/1646
|
||||||
Owner.Delete();
|
Owner.SpawnTimer(TimeSpan.Zero, () => Owner.Delete());
|
||||||
|
_deletionRequested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(float frameTime)
|
public void Update(float frameTime)
|
||||||
|
|||||||
4
Resources/Changelog/Parts/disposals.yml
Normal file
4
Resources/Changelog/Parts/disposals.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Zumorica
|
||||||
|
changes:
|
||||||
|
- type: Fix
|
||||||
|
message: Fixes not being able to flush humans down disposal units.
|
||||||
Reference in New Issue
Block a user