Explosion refactor TEST MERG (#6995)
* Explosions * fix yaml typo and prevent silly UI inputs * oop Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
@@ -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, IExAct, IAfterInteract
|
||||
public sealed class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IActivate, IStorageComponent, IDestroyAct, IAfterInteract
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
@@ -667,30 +667,6 @@ 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