removed TryGetSound + made some SoundSpecifier datafields required
This commit is contained in:
@@ -80,7 +80,7 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
/// <summary>
|
||||
/// Sound that will get played when this reaction effect occurs.
|
||||
/// </summary>
|
||||
[DataField("sound")] private SoundSpecifier _sound = default!;
|
||||
[DataField("sound", required: true)] private SoundSpecifier _sound = default!;
|
||||
|
||||
protected AreaReactionEffect()
|
||||
{
|
||||
@@ -136,10 +136,7 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
areaEffectComponent.TryAddSolution(solution);
|
||||
areaEffectComponent.Start(amount, _duration, _spreadDelay, _removeDelay);
|
||||
|
||||
if (_sound.TryGetSound(out var sound))
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(solutionEntity), sound, solutionEntity, AudioHelpers.WithVariation(0.125f));
|
||||
}
|
||||
SoundSystem.Play(Filter.Pvs(solutionEntity), _sound.GetSound(), solutionEntity, AudioHelpers.WithVariation(0.125f));
|
||||
}
|
||||
|
||||
protected abstract SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity);
|
||||
|
||||
Reference in New Issue
Block a user