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