Fix SpawnItemsOnUse not playing sound (#27621)

Made SpamItemsOnUse play sound at entity coordinates instead of parenting
This commit is contained in:
Tayrtahn 2024-05-02 13:10:20 -04:00 committed by GitHub
parent 8909dc7d40
commit 9b17693396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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--;