Fix missing sounds (#4466)

* Fix missing sounds

* Make SoundHitSpecies fallback to SoundHit

* Fix crayon YAML

* Update PlaySoundBehavior YAML

* Fix required
This commit is contained in:
ShadowCommander
2021-08-13 21:31:37 -07:00
committed by GitHub
parent e938234e8c
commit b8e6a996d4
29 changed files with 104 additions and 45 deletions

View File

@@ -29,9 +29,8 @@ namespace Content.Server.Crayon
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
//TODO: useSound
[DataField("useSound", required: true)]
private SoundSpecifier _useSound = default!;
[DataField("useSound")]
private SoundSpecifier? _useSound = null;
[ViewVariables]
public Color Color { get; set; }
@@ -139,7 +138,8 @@ namespace Content.Server.Crayon
appearance.SetData(CrayonVisuals.Rotation, eventArgs.User.Transform.LocalRotation);
}
SoundSystem.Play(Filter.Pvs(Owner), _useSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
if (_useSound != null)
SoundSystem.Play(Filter.Pvs(Owner), _useSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
// Decrease "Ammo"
Charges--;