removed TryGetSound + made some SoundSpecifier datafields required
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Content.Server.Damage.Components
|
||||
public int BaseDamage { get; set; } = 5;
|
||||
[DataField("factor")]
|
||||
public float Factor { get; set; } = 1f;
|
||||
[DataField("soundHit")]
|
||||
[DataField("soundHit", required: true)]
|
||||
public SoundSpecifier SoundHit { get; set; } = default!;
|
||||
[DataField("stunChance")]
|
||||
public float StunChance { get; set; } = 0.25f;
|
||||
|
||||
@@ -34,8 +34,7 @@ namespace Content.Server.Damage
|
||||
|
||||
if (speed < component.MinimumSpeed) return;
|
||||
|
||||
if (component.SoundHit.TryGetSound(out var soundHit))
|
||||
SoundSystem.Play(Filter.Pvs(otherBody), soundHit, otherBody, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
|
||||
SoundSystem.Play(Filter.Pvs(otherBody), component.SoundHit.GetSound(), otherBody, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
|
||||
|
||||
if ((_gameTiming.CurTime - component.LastHit).TotalSeconds < component.DamageCooldown)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user