Inserted SoundSpecifier where appropiate
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user