unbreak voice playback in team creation
authornemo
Thu, 11 Aug 2011 22:33:56 -0400
changeset 5545 980d44fe2d4c
parent 5543 5e597b725316
child 5547 2fe1d68a102c
unbreak voice playback in team creation
QTfrontend/pageeditteam.cpp
--- a/QTfrontend/pageeditteam.cpp	Thu Aug 11 00:18:10 2011 +0200
+++ b/QTfrontend/pageeditteam.cpp	Thu Aug 11 22:33:56 2011 -0400
@@ -358,16 +358,14 @@
     mySdli->SDLMusicInit();
     
     tmpdir.cd(cfgdir->absolutePath());
-    tmpdir.cd("Data/Sounds/voices");
-    tmpdir.cd(CBVoicepack->currentText());
-    
-    if (!tmpdir.exists()) {
+    if (!tmpdir.cd("Data/Sounds/voices") && !tmpdir.cd(CBVoicepack->currentText())) {
         tmpdir.cd(datadir->absolutePath());
         tmpdir.cd("Sounds/voices");
         tmpdir.cd(CBVoicepack->currentText());
     }
 
     QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
+
     if (list.size()) {
         sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
         Mix_PlayChannel(-1, sound, 0);