explosion minor rework + fix (#21718)

This commit is contained in:
deltanedas
2023-11-19 17:44:42 +00:00
committed by GitHub
parent db76d85f36
commit f25773ffec
10 changed files with 148 additions and 62 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.Administration.Managers;
using Content.Shared.Administration;
using Content.Shared.Explosion;
using Content.Shared.Ghost;
using Content.Shared.Hands;
using Content.Shared.Lock;
@@ -27,6 +28,7 @@ public sealed partial class StorageSystem : SharedStorageSystem
base.Initialize();
SubscribeLocalEvent<StorageComponent, GetVerbsEvent<ActivationVerb>>(AddUiVerb);
SubscribeLocalEvent<StorageComponent, BoundUIClosedEvent>(OnBoundUIClosed);
SubscribeLocalEvent<StorageComponent, BeforeExplodeEvent>(OnExploded);
SubscribeLocalEvent<StorageFillComponent, MapInitEvent>(OnStorageFillMapInit);
}
@@ -97,6 +99,11 @@ public sealed partial class StorageSystem : SharedStorageSystem
}
}
private void OnExploded(Entity<StorageComponent> ent, ref BeforeExplodeEvent args)
{
args.Contents.AddRange(ent.Comp.Container.ContainedEntities);
}
/// <summary>
/// Opens the storage UI for an entity
/// </summary>