removed TryGetSound + made some SoundSpecifier datafields required

This commit is contained in:
Galactic Chimp
2021-07-31 19:52:33 +02:00
parent 8ff703c338
commit 57016d14b4
114 changed files with 519 additions and 785 deletions

View File

@@ -17,7 +17,7 @@ namespace Content.Server.Storage.Components
[RegisterComponent]
public class CursedEntityStorageComponent : EntityStorageComponent
{
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
public override string Name => "CursedEntityStorage";
@@ -42,7 +42,7 @@ namespace Content.Server.Storage.Components
var locker = lockerEnt.GetComponent<EntityStorageComponent>();
if(locker.Open)
if (locker.Open)
locker.TryCloseStorage(Owner);
foreach (var entity in Contents.ContainedEntities.ToArray())
@@ -51,10 +51,8 @@ namespace Content.Server.Storage.Components
locker.Insert(entity);
}
if(_cursedSound.TryGetSound(out var cursedSound))
SoundSystem.Play(Filter.Pvs(Owner), cursedSound, Owner, AudioHelpers.WithVariation(0.125f));
if(_cursedLockerSound.TryGetSound(out var cursedLockerSound))
SoundSystem.Play(Filter.Pvs(lockerEnt), cursedLockerSound, lockerEnt, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), _cursedSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(lockerEnt), _cursedLockerSound.GetSound(), lockerEnt, AudioHelpers.WithVariation(0.125f));
}
}
}