Inserted SoundSpecifier where appropiate

This commit is contained in:
Galactic Chimp
2021-07-31 15:17:16 +02:00
parent 41c30aa28b
commit b2e40d540f
90 changed files with 663 additions and 368 deletions

View File

@@ -26,9 +26,8 @@ namespace Content.Server.Projectiles.Components
public bool DeleteOnCollide { get; } = true;
// Get that juicy FPS hit sound
[DataField("soundHit")] public string? SoundHit = default;
private SoundSpecifier _soundHit = default!;
[DataField("soundHitSpecies")] public string? SoundHitSpecies = default;
[DataField("soundHit")] public SoundSpecifier SoundHit = default!;
[DataField("soundHitSpecies")] public SoundSpecifier SoundHitSpecies = default!;
public bool DamagedEntity;

View File

@@ -33,13 +33,13 @@ namespace Content.Server.Projectiles
var playerFilter = Filter.Pvs(coordinates);
if (!otherEntity.Deleted &&
otherEntity.HasComponent<SharedBodyComponent>() && component.SoundHitSpecies != null)
otherEntity.HasComponent<SharedBodyComponent>() && component.SoundHitSpecies.TryGetSound(out var soundHitSpecies))
{
SoundSystem.Play(playerFilter, component.SoundHitSpecies, coordinates);
SoundSystem.Play(playerFilter, soundHitSpecies, coordinates);
}
else if (component.SoundHit != null)
else if (component.SoundHit.TryGetSound(out var soundHit))
{
SoundSystem.Play(playerFilter, component.SoundHit, coordinates);
SoundSystem.Play(playerFilter, soundHit, coordinates);
}
if (!otherEntity.Deleted && otherEntity.TryGetComponent(out IDamageableComponent? damage))