Skip to content

Commit

Permalink
теперь не получится спастись в контейнерах от ядерки
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkiich committed Jun 25, 2024
1 parent d959d8a commit 4f66b3f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Shared.Explosion;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Disposal.Tube;
using Content.Server.Disposal.Tube.Components;
Expand Down Expand Up @@ -79,6 +80,7 @@ public override void Initialize()
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);
Expand Down Expand Up @@ -381,6 +383,11 @@ private void OnDestruction(EntityUid uid, SharedDisposalUnitComponent component,
TryEjectContents(uid, component);
}

private void OnExploded(Entity<DisposalUnitComponent> ent, ref BeforeExplodeEvent args)
{
args.Contents.AddRange(ent.Comp.Container.ContainedEntities);
}

private void OnDragDropOn(EntityUid uid, SharedDisposalUnitComponent component, ref DragDropTargetEvent args)
{
args.Handled = TryInsert(uid, args.Dragged, args.User);
Expand Down

0 comments on commit 4f66b3f

Please sign in to comment.