summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Dubé <159546+serprex@users.noreply.github.com>2026-04-14 01:00:16 +0000
committerGitHub <noreply@github.com>2026-04-14 01:00:16 +0000
commitadb1e46ba9bb847d39c5b371aa3ec06ecc5ddbdf (patch)
treeaac1bf4591f175ec72f0bcd785cd1f3ff73a41f6
parent13ebc31ec745951364b4fb02cda000ee1590b169 (diff)
fix bad args handling in extractor (#6501)9.2.2
-rw-r--r--soh/soh/OTRGlobals.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp
index 7cfdfc92f..39f04ddbb 100644
--- a/soh/soh/OTRGlobals.cpp
+++ b/soh/soh/OTRGlobals.cpp
@@ -403,7 +403,7 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) {
std::vector<std::string> args;
if (argc > 1) {
for (int i = 1; i < argc; i++) {
- args.push_back(argv[argc]);
+ args.push_back(argv[i]);
}
}
Extractor extract;
@@ -462,7 +462,7 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) {
#elif (defined(__WIIU__) || defined(__SWITCH__))
extractStep = ES_VERIFY;
#else
- extractStep = ES_EXTRACT;
+ extractStep = args.empty() ? ES_EXTRACT : ES_EXTRACT_ARGS;
#endif
} else {
std::string msg;
@@ -547,11 +547,7 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) {
"OK", "", [&]() { exit(0); });
} else {
windowsStep = WS_DONE;
- if (args.size() > 0) {
- extractStep = ES_EXTRACT_ARGS;
- } else {
- extractStep = ES_EXTRACT;
- }
+ extractStep = args.empty() ? ES_EXTRACT : ES_EXTRACT_ARGS;
}
continue;
}
@@ -562,7 +558,7 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) {
}
case ES_EXTRACT_ARGS: {
#if !defined(__SWITCH__) && !defined(__WIIU__)
- if (args.size() == 0) {
+ if (args.empty()) {
SohGui::RegisterPopup(
"Run Ship of Harkinian", "All files have been processed. Run SoH?", "Yes", "No",
[&]() {