From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Tue, 20 Jan 2026 21:11:40 +0000 (+0100) Subject: Fix handheld grinder and reaction mixer audio stacking (#42498) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=cf19062414953efdbacf0dbfaf0184b22df3669b;p=space-station-14.git Fix handheld grinder and reaction mixer audio stacking (#42498) * yeah * AAAAAAAAAAAAAAAAAAAAAAA --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- diff --git a/Content.Shared/Chemistry/Reaction/ReactionMixerSystem.cs b/Content.Shared/Chemistry/Reaction/ReactionMixerSystem.cs index 030c8b890c..bd5b481517 100644 --- a/Content.Shared/Chemistry/Reaction/ReactionMixerSystem.cs +++ b/Content.Shared/Chemistry/Reaction/ReactionMixerSystem.cs @@ -42,9 +42,6 @@ public sealed partial class ReactionMixerSystem : EntitySystem if (!CanMix(ent.AsNullable(), ent)) return; - if (_net.IsServer) // Cannot cancel predicted audio. - ent.Comp.AudioStream = _audio.PlayPvs(ent.Comp.MixingSound, ent)?.Entity; - var doAfterArgs = new DoAfterArgs(EntityManager, args.User, ent.Comp.TimeToMix, @@ -60,7 +57,8 @@ public sealed partial class ReactionMixerSystem : EntitySystem BreakOnMove = true }; - _doAfter.TryStartDoAfter(doAfterArgs); + if (_doAfter.TryStartDoAfter(doAfterArgs)) + ent.Comp.AudioStream = _audio.PlayPredicted(ent.Comp.MixingSound, ent, args.User)?.Entity ?? ent.Comp.AudioStream; } private void OnAfterInteract(Entity ent, ref AfterInteractEvent args) @@ -71,12 +69,11 @@ public sealed partial class ReactionMixerSystem : EntitySystem if (!CanMix(ent.AsNullable(), args.Target.Value)) return; - if (_net.IsServer) // Cannot cancel predicted audio. - ent.Comp.AudioStream = _audio.PlayPvs(ent.Comp.MixingSound, ent)?.Entity; - var doAfterArgs = new DoAfterArgs(EntityManager, args.User, ent.Comp.TimeToMix, new ReactionMixDoAfterEvent(), ent, args.Target.Value, ent); - _doAfter.TryStartDoAfter(doAfterArgs); + if (_doAfter.TryStartDoAfter(doAfterArgs)) + ent.Comp.AudioStream = _audio.PlayPredicted(ent.Comp.MixingSound, ent, args.User)?.Entity ?? ent.Comp.AudioStream; + args.Handled = true; } diff --git a/Content.Shared/Kitchen/Components/EntitySystems/HandheldGrinderSystem.cs b/Content.Shared/Kitchen/Components/EntitySystems/HandheldGrinderSystem.cs index 30e61c8501..26130d6d30 100644 --- a/Content.Shared/Kitchen/Components/EntitySystems/HandheldGrinderSystem.cs +++ b/Content.Shared/Kitchen/Components/EntitySystems/HandheldGrinderSystem.cs @@ -67,9 +67,6 @@ internal sealed class HandheldGrinderSystem : EntitySystem if (!_solution.ResolveSolution(ent.Owner, ent.Comp.SolutionName, ref ent.Comp.GrinderSolution)) return; - if (_net.IsServer) // Cannot cancel predicted audio. - ent.Comp.AudioStream = _audio.PlayPvs(ent.Comp.Sound, ent)?.Entity; - var doAfter = new DoAfterArgs(EntityManager, args.User, ent.Comp.DoAfterDuration, new HandheldGrinderDoAfterEvent(), ent, ent, item) { NeedHand = true, @@ -79,7 +76,8 @@ internal sealed class HandheldGrinderSystem : EntitySystem BreakOnMove = true }; - _doAfter.TryStartDoAfter(doAfter); + if (_doAfter.TryStartDoAfter(doAfter)) + ent.Comp.AudioStream = _audio.PlayPredicted(ent.Comp.Sound, ent, args.User)?.Entity ?? ent.Comp.AudioStream; } private void OnHandheldDoAfter(Entity ent, ref HandheldGrinderDoAfterEvent args)