Revert "Explosion refactor TEST MERG (#6995)" (#7005)

This commit is contained in:
Leon Friedrich
2022-03-06 06:02:34 +13:00
committed by GitHub
parent cd1902cdf2
commit c95516e5b2
71 changed files with 766 additions and 3964 deletions

View File

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