Fix disposals being effective nuclear bunkers (#29438)

Make disposals report their contents to the explosion system
This commit is contained in:
Doomsdrayk 2024-06-26 08:25:42 -06:00 committed by null
parent 6a59326d1e
commit 6eeb96e202
No known key found for this signature in database
GPG Key ID: 212F05528FD678BE
1 changed files with 8 additions and 0 deletions

View File

@ -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>