public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{
var scale = (float) IoCManager.Resolve<IRobustRandom>().NextGaussian(1, Variation);
- entityManager.EntitySysManager.GetEntitySystem<SharedAudioSystem>()
- .PlayPvs(Sound, uid, AudioParams.WithPitchScale(scale));
+ if (entityManager.TryGetComponent<TransformComponent>(uid, out var xform))
+ entityManager.EntitySysManager.GetEntitySystem<SharedAudioSystem>()
+ .PlayPvs(Sound, xform.Coordinates, AudioParams.WithPitchScale(scale));
}
}
}