aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mumd/src/audio.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs
index af6f9d7..4b64866 100644
--- a/mumd/src/audio.rs
+++ b/mumd/src/audio.rs
@@ -136,13 +136,13 @@ impl AudioOutput {
for effect in sound_effects {
if let Ok(event) = NotificationEvent::try_from(effect.event.as_str()) {
let file = PathBuf::from(&effect.file);
- let id = self
- .sound_effects
- .open(&file)
- .unwrap_or_else(|_| SoundEffects::default_sound_effect());
- self.sound_effect_events.insert(event, id);
+ if let Ok(id) = self.sound_effects.open(&file) {
+ self.sound_effect_events.insert(event, id);
+ } else {
+ warn!("Invalid sound data in '{}'", &effect.file);
+ }
} else {
- warn!("Unknown sound effect '{}'", effect.event);
+ warn!("Unknown sound effect '{}'", &effect.event);
}
}
}