From: Tayrtahn Date: Thu, 2 May 2024 17:10:20 +0000 (-0400) Subject: Fix SpawnItemsOnUse not playing sound (#27621) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9b176933969b00e70d52bbb9b960ed631f09b0ac;p=space-station-14.git Fix SpawnItemsOnUse not playing sound (#27621) Made SpamItemsOnUse play sound at entity coordinates instead of parenting --- diff --git a/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs b/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs index c49bfdec93..4c533ede3a 100644 --- a/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs +++ b/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs @@ -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--;