From 9c1b543be736d39aec19ee74e28bca496a500e6d Mon Sep 17 00:00:00 2001 From: Admiral-Fish Date: Wed, 9 Aug 2023 18:01:05 -0700 Subject: [PATCH] Tweak order of customs Fixes #326 --- Source/Form/Util/Researcher.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Source/Form/Util/Researcher.cpp b/Source/Form/Util/Researcher.cpp index 522de4f18..92996e8c0 100644 --- a/Source/Form/Util/Researcher.cpp +++ b/Source/Form/Util/Researcher.cpp @@ -46,17 +46,13 @@ static std::vector getStates(RNGType rng, u32 initial, u32 max) { std::vector states; - if constexpr (std::is_same::value || std::is_same::value || std::is_same::value - || std::is_same::value || std::is_same::value || std::is_same::value - || std::is_same::value || std::is_same::value || std::is_same::value - || std::is_same::value || std::is_same::value - || std::is_same::value) + if constexpr (std::is_same::value || std::is_same::value) { - rng.jump(initial); + rng.advance(initial); } else { - rng.advance(initial); + rng.jump(initial); } for (u32 i = 0; i < max; i++) @@ -122,8 +118,16 @@ Researcher::Researcher(QWidget *parent) : QWidget(parent), ui(new Ui::Researcher customs.erase(customs.begin()); } - customs.emplace_back(toInt(Custom::Custom1) + i - 1); - customs.emplace_back(toInt(Custom::Previous1) + i - 1); + if (i == 1) + { + customs.emplace_back(toInt(Custom::Custom1) + i - 1); + customs.emplace_back(toInt(Custom::Previous1) + i - 1); + } + else + { + customs.insert(std::find(customs.begin(), customs.end(), toInt(Custom::Custom1) + i - 2) + 1, toInt(Custom::Custom1) + i - 1); + customs.emplace_back(toInt(Custom::Previous1) + i - 1); + } } connect(ui->pushButtonGenerate, &QPushButton::clicked, this, &Researcher::generate);