From dbd42386da316a7dcbd9495c7233d4b175e6135f Mon Sep 17 00:00:00 2001 From: Nicolay Korslund Date: Sat, 14 Aug 2010 21:43:25 +0200 Subject: [PATCH] temporary try/catch around sound loading --- apps/openmw/mwsound/soundmanager.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwsound/soundmanager.cpp b/apps/openmw/mwsound/soundmanager.cpp index b5a7a84fe2..95b0135689 100644 --- a/apps/openmw/mwsound/soundmanager.cpp +++ b/apps/openmw/mwsound/soundmanager.cpp @@ -119,13 +119,20 @@ namespace MWSound float min, float max, bool loop) { - SoundPtr snd = mgr->load(file); - snd->setRepeat(loop); - snd->setVolume(volume); - snd->setPitch(pitch); - snd->setRange(min,max); - setPos(snd, reference); - snd->play(); + try + { + SoundPtr snd = mgr->load(file); + snd->setRepeat(loop); + snd->setVolume(volume); + snd->setPitch(pitch); + snd->setRange(min,max); + setPos(snd, reference); + snd->play(); + } + catch(...) + { + cout << "Error loading " << file << ", skipping.\n"; + } } // Stop a sound and remove it from the list. If id="" then