+using System.Collections.Frozen;
+using System.Linq;
using Content.Shared.Administration.Logs;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.EntityEffects;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio.Systems;
+using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
-using System.Collections.Frozen;
-using System.Linq;
namespace Content.Shared.Chemistry.Reaction
/// </summary>
private const int MaxReactionIterations = 20;
+ [Dependency] private readonly INetManager _netMan = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
- [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
+ [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
/// <summary>
effect.Effect(args);
}
- _audio.PlayPvs(reaction.Sound, soln);
+ // Someday, some brave soul will thread through an optional actor
+ // argument in from every call of OnReaction up, all just to pass
+ // it to PlayPredicted. I am not that brave soul.
+ if (_netMan.IsServer)
+ _audio.PlayPvs(reaction.Sound, soln);
}
/// <summary>
/// </summary>
private bool ProcessReactions(Entity<SolutionComponent> soln, SortedSet<ReactionPrototype> reactions, ReactionMixerComponent? mixerComponent)
{
- HashSet<ReactionPrototype> toRemove = new();
List<string>? products = null;
// attempt to perform any applicable reaction
{
if (!CanReact(soln, reaction, mixerComponent, out var unitReactions))
{
- toRemove.Add(reaction);
continue;
}