From 0c9dfa526461b443e722767f5ab8dc84b28895bc Mon Sep 17 00:00:00 2001 From: rtldg Date: Mon, 4 Mar 2024 10:28:03 +0000 Subject: [PATCH] bug fix 'grab launch options from steam too' --- RawInput2/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RawInput2/main.cpp b/RawInput2/main.cpp index fefe1e6..28e5125 100644 --- a/RawInput2/main.cpp +++ b/RawInput2/main.cpp @@ -595,13 +595,20 @@ std::string GetCSSLaunchOptions(std::string const & steampath, std::string const { if (line.rfind("\t\t\t\t\t\"240\"", 0) == 0) in_css = true; + if (line.rfind("\t\t\t\t\t}", 0) == 0) + in_css = false; #define LLLLL "\t\t\t\t\t\t\"LaunchOptions\"\t\t\"" - if (line.rfind(LLLLL, 0) == 0) + if (in_css && line.rfind(LLLLL, 0) == 0) { line = line.substr(sizeof(LLLLL) - 1, line.size() - sizeof(LLLLL)); line = ReplaceString(line, "\\\\", "\\"); return line; } +#if 1 + // You're not going to believe it but this section is required to not crash when spawning in. + for (int i = 0; i < 5; i++) + (void)GetCurrentProcessId(); +#endif } return ""; }