diff --git a/HCADecoder b/HCADecoder index af76935..4197fe8 160000 --- a/HCADecoder +++ b/HCADecoder @@ -1 +1 @@ -Subproject commit af7693590fa3de42a0dd62a5195e53422ceaf7af +Subproject commit 4197fe83ba1a3b206fd31e4b13a349edc1aecd7e diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7df6066..2b934d0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -195,16 +195,19 @@ void MainWindow::setIdolVol(int value) void MainWindow::randomize() { - std::set seenset; - int n; - for(int i = 0; i < unitsize; ++i) + if(idolsel[0]->count() > 1) { - do + std::set seenset; + int n; + for(int i = 0; i < unitsize; ++i) { - n = rand() % (idolsel[i]->count() - 1) + 1; - } while(seenset.find(n) != seenset.end()); - seenset.insert(n); - idolsel[i]->setCurrentIndex(n); + do + { + n = rand() % (idolsel[i]->count() - 1) + 1; + } while(seenset.find(n) != seenset.end()); + seenset.insert(n); + idolsel[i]->setCurrentIndex(n); + } } }