From 9b176933969b00e70d52bbb9b960ed631f09b0ac Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Thu, 2 May 2024 13:10:20 -0400 Subject: [PATCH] Fix SpawnItemsOnUse not playing sound (#27621) Made SpamItemsOnUse play sound at entity coordinates instead of parenting --- Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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--; -- 2.52.0