From 3cf3d05b7bfc30b9573ddaaf1e31ea1c8fafa4d7 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 20 Mar 2024 06:42:39 +0100 Subject: [PATCH] dont play second sound when sending message --- src/audio.rs | 4 ++++ src/world.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio.rs b/src/audio.rs index a3ad894..9684be0 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -131,6 +131,10 @@ pub fn play_sfx( events_sfx.clear(); } for sfx in events_sfx.read() { + match sfx.0 { + Sfx::None => { continue; } + _ => {} + } commands.spawn(AudioBundle { source: match sfx.0 { Sfx::Switch => sound_switch.0.clone(), diff --git a/src/world.rs b/src/world.rs index db148dc..48337f9 100644 --- a/src/world.rs +++ b/src/world.rs @@ -377,7 +377,7 @@ impl ParserState { name: self.name.clone(), label: self.label.clone(), delay: self.delay.clone(), - sound: "chat".to_string(), + sound: if self.is_choice { "".to_string() } else { "chat".to_string() }, level: self.level.clone(), reply: if self.is_choice { "".to_string() } else { self.text.clone() }, choice: if self.is_choice { self.text.clone() } else { "".to_string() },