Skip to content

Commit 0c9dfa5

Browse files
committed
bug fix 'grab launch options from steam too'
1 parent 6ba01fd commit 0c9dfa5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

RawInput2/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,20 @@ std::string GetCSSLaunchOptions(std::string const & steampath, std::string const
595595
{
596596
if (line.rfind("\t\t\t\t\t\"240\"", 0) == 0)
597597
in_css = true;
598+
if (line.rfind("\t\t\t\t\t}", 0) == 0)
599+
in_css = false;
598600
#define LLLLL "\t\t\t\t\t\t\"LaunchOptions\"\t\t\""
599-
if (line.rfind(LLLLL, 0) == 0)
601+
if (in_css && line.rfind(LLLLL, 0) == 0)
600602
{
601603
line = line.substr(sizeof(LLLLL) - 1, line.size() - sizeof(LLLLL));
602604
line = ReplaceString(line, "\\\\", "\\");
603605
return line;
604606
}
607+
#if 1
608+
// You're not going to believe it but this section is required to not crash when spawning in.
609+
for (int i = 0; i < 5; i++)
610+
(void)GetCurrentProcessId();
611+
#endif
605612
}
606613
return "";
607614
}

0 commit comments

Comments
 (0)