From 4efd4248bbf97f081f4a750651ea900ebfc1b96e Mon Sep 17 00:00:00 2001 From: KinoMyu Date: Sat, 31 Mar 2018 16:44:30 -0700 Subject: [PATCH] Update submodule in preparation for USOTSUKI --- HCADecoder | 2 +- src/mainwindow.cpp | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) 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); + } } }