diff --git a/Content.Client/Disposal/DisposalUnitComponent.cs b/Content.Client/Disposal/DisposalUnitComponent.cs index b6bad6b717..e63a3fd45e 100644 --- a/Content.Client/Disposal/DisposalUnitComponent.cs +++ b/Content.Client/Disposal/DisposalUnitComponent.cs @@ -3,7 +3,6 @@ using Content.Shared.Disposal.Components; namespace Content.Client.Disposal; [RegisterComponent] -[ComponentReference(typeof(SharedDisposalUnitComponent))] public sealed partial class DisposalUnitComponent : SharedDisposalUnitComponent { diff --git a/Content.Client/Disposal/Systems/DisposalUnitSystem.cs b/Content.Client/Disposal/Systems/DisposalUnitSystem.cs index 9a2f207925..fff235308e 100644 --- a/Content.Client/Disposal/Systems/DisposalUnitSystem.cs +++ b/Content.Client/Disposal/Systems/DisposalUnitSystem.cs @@ -48,6 +48,11 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem component.RecentlyEjected.AddRange(state.RecentlyEjected); } + public override bool HasDisposals(EntityUid? uid) + { + return HasComp(uid); + } + public override void DoInsertDisposalUnit(EntityUid uid, EntityUid toInsert, EntityUid user, SharedDisposalUnitComponent? disposal = null) { return; diff --git a/Content.Server/Disposal/Unit/Components/DisposalUnitComponent.cs b/Content.Server/Disposal/Unit/Components/DisposalUnitComponent.cs index 01e30109ee..548af039da 100644 --- a/Content.Server/Disposal/Unit/Components/DisposalUnitComponent.cs +++ b/Content.Server/Disposal/Unit/Components/DisposalUnitComponent.cs @@ -6,7 +6,6 @@ namespace Content.Server.Disposal.Unit.Components; // GasMixture life. [RegisterComponent] -[ComponentReference(typeof(SharedDisposalUnitComponent))] public sealed partial class DisposalUnitComponent : SharedDisposalUnitComponent { [DataField("air")] diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index d98af4bf20..76082f8b8d 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -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(uid); + } + public override bool CanInsert(EntityUid uid, SharedDisposalUnitComponent component, EntityUid entity) { if (!base.CanInsert(uid, component, entity) || component is not SharedDisposalUnitComponent serverComp) diff --git a/Content.Shared/Disposal/SharedDisposalUnitSystem.cs b/Content.Shared/Disposal/SharedDisposalUnitSystem.cs index e96c45a62c..475dd8e78b 100644 --- a/Content.Shared/Disposal/SharedDisposalUnitSystem.cs +++ b/Content.Shared/Disposal/SharedDisposalUnitSystem.cs @@ -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); + /// /// Gets the current pressure state of a disposals unit. /// diff --git a/Content.Shared/Storage/EntitySystems/DumpableSystem.cs b/Content.Shared/Storage/EntitySystems/DumpableSystem.cs index 0e5a4fd796..2131fdc9e8 100644 --- a/Content.Shared/Storage/EntitySystems/DumpableSystem.cs +++ b/Content.Shared/Storage/EntitySystems/DumpableSystem.cs @@ -37,7 +37,7 @@ public sealed class DumpableSystem : EntitySystem if (!args.CanReach || args.Handled) return; - if (!HasComp(args.Target) && !HasComp(args.Target)) + if (!_disposalUnitSystem.HasDisposals(args.Target) && !HasComp(args.Target)) return; StartDoAfter(uid, args.Target.Value, args.User, component); @@ -72,7 +72,7 @@ public sealed class DumpableSystem : EntitySystem if (!TryComp(uid, out var storage) || storage.StoredEntities == null || storage.StoredEntities.Count == 0) return; - if (HasComp(args.Target)) + if (_disposalUnitSystem.HasDisposals(args.Target)) { UtilityVerb verb = new() { @@ -142,7 +142,7 @@ public sealed class DumpableSystem : EntitySystem var dumped = false; - if (HasComp(args.Args.Target.Value)) + if (_disposalUnitSystem.HasDisposals(args.Args.Target.Value)) { dumped = true;