# HG changeset patch # User nemo # Date 1313116436 14400 # Node ID 980d44fe2d4c3abd5c0d816195deef0cab0be545 # Parent 5e597b72531654cc4a3d29c8f4134675a7a95c9c unbreak voice playback in team creation diff -r 5e597b725316 -r 980d44fe2d4c 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);