From 8a9ba69bae4d27419435a8c20e7123f90432c0c4 Mon Sep 17 00:00:00 2001 From: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon, 8 Apr 2024 13:18:07 +0100 Subject: [PATCH] Fix Rodio panic --- voxygen/src/audio/mod.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/voxygen/src/audio/mod.rs b/voxygen/src/audio/mod.rs index 4ee26a485c..3fcdab1bb5 100644 --- a/voxygen/src/audio/mod.rs +++ b/voxygen/src/audio/mod.rs @@ -23,7 +23,7 @@ use vek::*; use crate::hud::Subtitle; -#[derive(Default, Clone)] +#[derive(Clone)] pub struct Listener { pub pos: Vec3, pub ori: Vec3, @@ -32,6 +32,17 @@ pub struct Listener { ear_right_rpos: Vec3, } +impl Default for Listener { + fn default() -> Self { + Self { + pos: Default::default(), + ori: Default::default(), + ear_left_rpos: Vec3::unit_x(), + ear_right_rpos: -Vec3::unit_x(), + } + } +} + /// Holds information about the system audio devices and internal channels used /// for sfx and music playback. An instance of `AudioFrontend` is used by /// Voxygen's [`GlobalState`](../struct.GlobalState.html#structfield.audio) to