DumpableComponent on an empty container no longer stops other interactions (#22831)
DumpableComponent does not block the entity from being disposed via InteractOn a DisposalUnit
This commit is contained in:
@@ -5,7 +5,6 @@ using Content.Shared.Interaction;
|
|||||||
using Content.Shared.Placeable;
|
using Content.Shared.Placeable;
|
||||||
using Content.Shared.Storage.Components;
|
using Content.Shared.Storage.Components;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
@@ -42,6 +41,12 @@ public sealed class DumpableSystem : EntitySystem
|
|||||||
if (!_disposalUnitSystem.HasDisposals(args.Target) && !HasComp<PlaceableSurfaceComponent>(args.Target))
|
if (!_disposalUnitSystem.HasDisposals(args.Target) && !HasComp<PlaceableSurfaceComponent>(args.Target))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!TryComp<StorageComponent>(uid, out var storage))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!storage.Container.ContainedEntities.Any())
|
||||||
|
return;
|
||||||
|
|
||||||
StartDoAfter(uid, args.Target.Value, args.User, component);
|
StartDoAfter(uid, args.Target.Value, args.User, component);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
@@ -103,12 +108,12 @@ public sealed class DumpableSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartDoAfter(EntityUid storageUid, EntityUid? targetUid, EntityUid userUid, DumpableComponent dumpable)
|
private void StartDoAfter(EntityUid storageUid, EntityUid? targetUid, EntityUid userUid, DumpableComponent dumpable)
|
||||||
{
|
{
|
||||||
if (!TryComp<StorageComponent>(storageUid, out var storage))
|
if (!TryComp<StorageComponent>(storageUid, out var storage))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float delay = storage.Container.ContainedEntities.Count * (float) dumpable.DelayPerItem.TotalSeconds * dumpable.Multiplier;
|
var delay = storage.Container.ContainedEntities.Count * (float) dumpable.DelayPerItem.TotalSeconds * dumpable.Multiplier;
|
||||||
|
|
||||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, userUid, delay, new DumpableDoAfterEvent(), storageUid, target: targetUid, used: storageUid)
|
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, userUid, delay, new DumpableDoAfterEvent(), storageUid, target: targetUid, used: storageUid)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user