From 909190b9a7d6af45b695ffa0cb660d6819e1772a Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Tue, 11 Apr 2023 16:58:19 -0500 Subject: [PATCH] gk: fix "reboot in debug" option not working properly when `gk` has no args (#2469) --- game/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/game/main.cpp b/game/main.cpp index 56797a2ee..2103ed584 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -222,10 +222,13 @@ int main(int argc, char** argv) { while (true) { if (force_debug_next_time) { + // I'd like to check and not add duplicates, unfortunately since the game + // cares about ordering...that's likely error prone if the user passed args in the wrong order + // ie. -debug -boot (we'd skip adding things, but the order would be wrong). game_args.push_back("-boot"); game_args.push_back("-debug"); force_debug_next_time = false; - arg_ptrs.clear(); + arg_ptrs = {""}; // see above for rationale for (auto& str : game_args) { arg_ptrs.push_back(str.data()); }