@@ -43,7 +43,7 @@ namespace Content.Server.Storage.Components
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
[ComponentReference(typeof(IStorageComponent))]
|
||||
[ComponentReference(typeof(SharedStorageComponent))]
|
||||
public sealed class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IActivate, IStorageComponent, IDestroyAct, IAfterInteract
|
||||
public sealed class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IActivate, IStorageComponent, IDestroyAct, IExAct, IAfterInteract
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
@@ -667,6 +667,30 @@ namespace Content.Server.Storage.Components
|
||||
}
|
||||
}
|
||||
|
||||
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Severity < ExplosionSeverity.Heavy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var storedEntities = StoredEntities?.ToList();
|
||||
|
||||
if (storedEntities == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var entity in storedEntities)
|
||||
{
|
||||
var exActs = _entityManager.GetComponents<IExAct>(entity).ToArray();
|
||||
foreach (var exAct in exActs)
|
||||
{
|
||||
exAct.OnExplosion(eventArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PlaySoundCollection()
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), StorageSoundCollection.GetSound(), Owner, AudioParams.Default);
|
||||
|
||||
Reference in New Issue
Block a user