Fix disposals being effective nuclear bunkers (#29438)
Make disposals report their contents to the explosion system
This commit is contained in:
@@ -17,6 +17,7 @@ using Content.Shared.Disposal.Components;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.DragDrop;
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Explosion;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.IdentityManagement;
|
||||
@@ -76,6 +77,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
SubscribeLocalEvent<DisposalUnitComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, DragDropTargetEvent>(OnDragDropOn);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, DestructionEventArgs>(OnDestruction);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, BeforeExplodeEvent>(OnExploded);
|
||||
|
||||
SubscribeLocalEvent<DisposalUnitComponent, GetVerbsEvent<InteractionVerb>>(AddInsertVerb);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, GetVerbsEvent<AlternativeVerb>>(AddDisposalAltVerbs);
|
||||
@@ -778,6 +780,12 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
Joints.RecursiveClearJoints(inserted);
|
||||
UpdateVisualState(uid, component);
|
||||
}
|
||||
|
||||
private void OnExploded(Entity<DisposalUnitComponent> ent, ref BeforeExplodeEvent args)
|
||||
{
|
||||
args.Contents.AddRange(ent.Comp.Container.ContainedEntities);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user