]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixes grappling hook audio infinitely looping (#42588)
authordeathride58 <deathride58@users.noreply.github.com>
Fri, 23 Jan 2026 01:30:02 +0000 (20:30 -0500)
committerGitHub <noreply@github.com>
Fri, 23 Jan 2026 01:30:02 +0000 (01:30 +0000)
Fixes a regression with grappling hook sounds by reverting a last-minute commit

Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs

index b0afbfd2caa0f9674cce9641ba6f2ae1ba1a9464..a6f63f6a613a73c42200719f1903e9dee7305cd5 100644 (file)
@@ -173,10 +173,11 @@ public abstract class SharedGrapplingGunSystem : VirtualController
         if (value)
         {
             // We null-coalesce here because playing the sound again will cause it to become eternally stuck playing
-            component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user)?.Entity ?? component.Stream;
+            component.Stream ??= _audio.PlayPredicted(component.ReelSound, uid, user)?.Entity;
         }
-        else if (!value && component.Stream.HasValue)
+        else if (!value && component.Stream.HasValue && Timing.IsFirstTimePredicted)
         {
+            // The IsFirstTimePredicted check is important here because otherwise component.Stream will be set to null from an early cancellation if this isn't FirstTimePredicted
             component.Stream = _audio.Stop(component.Stream);
         }