@@ -3,7 +3,6 @@ using Content.Shared.Disposal.Components;
|
||||
namespace Content.Client.Disposal;
|
||||
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedDisposalUnitComponent))]
|
||||
public sealed partial class DisposalUnitComponent : SharedDisposalUnitComponent
|
||||
{
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
component.RecentlyEjected.AddRange(state.RecentlyEjected);
|
||||
}
|
||||
|
||||
public override bool HasDisposals(EntityUid? uid)
|
||||
{
|
||||
return HasComp<DisposalUnitComponent>(uid);
|
||||
}
|
||||
|
||||
public override void DoInsertDisposalUnit(EntityUid uid, EntityUid toInsert, EntityUid user, SharedDisposalUnitComponent? disposal = null)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace Content.Server.Disposal.Unit.Components;
|
||||
|
||||
// GasMixture life.
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedDisposalUnitComponent))]
|
||||
public sealed partial class DisposalUnitComponent : SharedDisposalUnitComponent
|
||||
{
|
||||
[DataField("air")]
|
||||
|
||||
@@ -728,10 +728,15 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
if (!component.Engaged)
|
||||
{
|
||||
component.NextFlush = null;
|
||||
Dirty(component);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HasDisposals(EntityUid? uid)
|
||||
{
|
||||
return HasComp<DisposalUnitComponent>(uid);
|
||||
}
|
||||
|
||||
public override bool CanInsert(EntityUid uid, SharedDisposalUnitComponent component, EntityUid entity)
|
||||
{
|
||||
if (!base.CanInsert(uid, component, entity) || component is not SharedDisposalUnitComponent serverComp)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Body.Components;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Disposal.Components;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.DragDrop;
|
||||
@@ -34,6 +35,8 @@ public abstract class SharedDisposalUnitSystem : EntitySystem
|
||||
// Percentage
|
||||
public const float PressurePerSecond = 0.05f;
|
||||
|
||||
public abstract bool HasDisposals([NotNullWhen(true)] EntityUid? uid);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current pressure state of a disposals unit.
|
||||
/// </summary>
|
||||
|
||||
@@ -37,7 +37,7 @@ public sealed class DumpableSystem : EntitySystem
|
||||
if (!args.CanReach || args.Handled)
|
||||
return;
|
||||
|
||||
if (!HasComp<SharedDisposalUnitComponent>(args.Target) && !HasComp<PlaceableSurfaceComponent>(args.Target))
|
||||
if (!_disposalUnitSystem.HasDisposals(args.Target) && !HasComp<PlaceableSurfaceComponent>(args.Target))
|
||||
return;
|
||||
|
||||
StartDoAfter(uid, args.Target.Value, args.User, component);
|
||||
@@ -72,7 +72,7 @@ public sealed class DumpableSystem : EntitySystem
|
||||
if (!TryComp<SharedStorageComponent>(uid, out var storage) || storage.StoredEntities == null || storage.StoredEntities.Count == 0)
|
||||
return;
|
||||
|
||||
if (HasComp<SharedDisposalUnitComponent>(args.Target))
|
||||
if (_disposalUnitSystem.HasDisposals(args.Target))
|
||||
{
|
||||
UtilityVerb verb = new()
|
||||
{
|
||||
@@ -142,7 +142,7 @@ public sealed class DumpableSystem : EntitySystem
|
||||
|
||||
var dumped = false;
|
||||
|
||||
if (HasComp<SharedDisposalUnitComponent>(args.Args.Target.Value))
|
||||
if (_disposalUnitSystem.HasDisposals(args.Args.Target.Value))
|
||||
{
|
||||
dumped = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user