]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix double sound for shutters (#23975)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Fri, 12 Jan 2024 20:35:31 +0000 (22:35 +0200)
committerGitHub <noreply@github.com>
Fri, 12 Jan 2024 20:35:31 +0000 (13:35 -0700)
Fix double sound

Content.Shared/Prying/Systems/PryingSystem.cs

index 36e42723df00bd1a2e9cf08a515b97a99020da11..7271258f5c4acbfbbb555c860754081ba27e5f60 100644 (file)
@@ -167,10 +167,19 @@ public sealed class PryingSystem : EntitySystem
             return;
         }
 
-        // TODO: When we get airlock prediction make this predicted.
+        // TODO: When we get airlock prediction make this fully predicted.
         // When that happens also fix the checking function in the Client AirlockSystem.
         if (args.Used != null && comp != null)
-            _audioSystem.PlayPvs(comp.UseSound, args.Used.Value);
+        {
+            if (HasComp<AirlockComponent>(uid))
+            {
+                _audioSystem.PlayPvs(comp.UseSound, args.Used.Value);
+            }
+            else
+            {
+                _audioSystem.PlayPredicted(comp.UseSound, args.Used.Value, args.User);
+            }
+        }
 
         var ev = new PriedEvent(args.User);
         RaiseLocalEvent(uid, ref ev);