]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix SpawnItemsOnUse not playing sound (#27621)
authorTayrtahn <tayrtahn@gmail.com>
Thu, 2 May 2024 17:10:20 +0000 (13:10 -0400)
committerGitHub <noreply@github.com>
Thu, 2 May 2024 17:10:20 +0000 (13:10 -0400)
Made SpamItemsOnUse play sound at entity coordinates instead of parenting

Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs

index c49bfdec9317459e24edbd46fcea487e223307c4..4c533ede3ad7ce01c4b36aada390b59e69b52f00 100644 (file)
@@ -82,7 +82,9 @@ namespace Content.Server.Storage.EntitySystems
 
             if (component.Sound != null)
             {
-                _audio.PlayPvs(component.Sound, uid);
+                // The entity is often deleted, so play the sound at its position rather than parenting
+                var coordinates = Transform(uid).Coordinates;
+                _audio.PlayPvs(component.Sound, coordinates);
             }
 
             component.Uses--;