Add imgui option to restart in retail mode (#4404)

This commit is contained in:
Matt Dallmeyer
2026-09-04 06:28:21 -07:00
committed by GitHub
parent 9c86c86c74
commit 2796e0974b
5 changed files with 23 additions and 1 deletions
+13
View File
@@ -242,6 +242,7 @@ int main(int argc, char** argv) {
}
bool force_debug_next_time = false;
bool force_retail_next_time = false;
// always start with an empty arg, as internally kmachine starts at `1` not `0`
std::vector<const char*> arg_ptrs = {""};
for (auto& str : game_args) {
@@ -261,6 +262,15 @@ int main(int argc, char** argv) {
arg_ptrs.push_back(str.data());
}
}
if (force_retail_next_time) {
force_retail_next_time = false;
arg_ptrs = {""}; // see above for rationale
for (auto& str : game_args) {
if (str != "-debug") {
arg_ptrs.push_back(str.data());
}
}
}
// run the runtime in a loop so we can reset the game and have it restart cleanly
lg::info("OpenGOAL Runtime {}.{}", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
@@ -276,6 +286,9 @@ int main(int argc, char** argv) {
case RuntimeExitStatus::RESTART_IN_DEBUG:
force_debug_next_time = true;
break;
case RuntimeExitStatus::RESTART_IN_RETAIL:
force_retail_next_time = true;
break;
}
} catch (std::exception& ex) {
lg::error("Unexpected exception occurred - {}", ex.what());