From: themias <89101928+themias@users.noreply.github.com> Date: Mon, 19 Aug 2024 03:01:43 +0000 (-0400) Subject: Fix cooking sizzle noise (#31096) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=db427dc58f9499541bb21887c75a50202f04b41a;p=space-station-14.git Fix cooking sizzle noise (#31096) --- 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)); } } }