@@ -35,7 +35,7 @@ namespace Content.Server.Storage.Components
|
||||
[Virtual]
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
[ComponentReference(typeof(IStorageComponent))]
|
||||
public class EntityStorageComponent : Component, IActivate, IStorageComponent, IInteractUsing, IDestroyAct
|
||||
public class EntityStorageComponent : Component, IActivate, IStorageComponent, IInteractUsing, IDestroyAct, IExAct
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
@@ -478,6 +478,24 @@ namespace Content.Server.Storage.Components
|
||||
var entityLookup = EntitySystem.Get<EntityLookupSystem>();
|
||||
return entityLookup.GetEntitiesIntersecting(Owner, _enteringRange, LookupFlags.Approximate);
|
||||
}
|
||||
|
||||
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Severity < ExplosionSeverity.Heavy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var containedEntities = Contents.ContainedEntities.ToList();
|
||||
foreach (var entity in containedEntities)
|
||||
{
|
||||
var exActs = _entMan.GetComponents<IExAct>(entity).ToArray();
|
||||
foreach (var exAct in exActs)
|
||||
{
|
||||
exAct.OnExplosion(eventArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class StorageOpenAttemptEvent : CancellableEntityEventArgs
|
||||
|
||||
Reference in New Issue
Block a user