From db427dc58f9499541bb21887c75a50202f04b41a Mon Sep 17 00:00:00 2001 From: themias <89101928+themias@users.noreply.github.com> Date: Sun, 18 Aug 2024 23:01:43 -0400 Subject: [PATCH] Fix cooking sizzle noise (#31096) --- Content.Server/Construction/Completions/PlaySound.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/Construction/Completions/PlaySound.cs b/Content.Server/Construction/Completions/PlaySound.cs index 50b705ddfe..75e0153922 100644 --- a/Content.Server/Construction/Completions/PlaySound.cs +++ b/Content.Server/Construction/Completions/PlaySound.cs @@ -22,8 +22,9 @@ namespace Content.Server.Construction.Completions public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) { var scale = (float) IoCManager.Resolve().NextGaussian(1, Variation); - entityManager.EntitySysManager.GetEntitySystem() - .PlayPvs(Sound, uid, AudioParams.WithPitchScale(scale)); + if (entityManager.TryGetComponent(uid, out var xform)) + entityManager.EntitySysManager.GetEntitySystem() + .PlayPvs(Sound, xform.Coordinates, AudioParams.WithPitchScale(scale)); } } } -- 2.52.0