mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 15:36:10 +00:00
Pass game arguments to beamng on windows
This commit is contained in:
parent
68a4d64387
commit
0c53ff4cd4
@ -84,7 +84,14 @@ void StartGame(std::string Dir) {
|
||||
std::string BaseDir = Dir; //+"\\Bin64";
|
||||
// Dir += R"(\Bin64\BeamNG.drive.x64.exe)";
|
||||
Dir += "\\BeamNG.drive.exe";
|
||||
bSuccess = CreateProcessA(Dir.c_str(), nullptr, nullptr, nullptr, TRUE, 0, nullptr, BaseDir.c_str(), &si, &pi);
|
||||
std::string gameArgs = "";
|
||||
|
||||
for (int i = 0; i < options.game_arguments_length; i++) {
|
||||
gameArgs += " ";
|
||||
gameArgs += options.game_arguments[i];
|
||||
}
|
||||
|
||||
bSuccess = CreateProcessA(nullptr, (LPSTR)(Dir + gameArgs).c_str(), nullptr, nullptr, TRUE, 0, nullptr, BaseDir.c_str(), &si, &pi);
|
||||
if (bSuccess) {
|
||||
info("Game Launched!");
|
||||
GamePID = pi.dwProcessId;
|
||||
|
@ -68,7 +68,7 @@ void InitOptions(int argc, char *argv[], Options &options) {
|
||||
options.no_download = true;
|
||||
options.no_launch = true;
|
||||
options.no_update = true;
|
||||
} else if (argument == "--") {
|
||||
} else if (argument == "--game") {
|
||||
options.game_arguments = &argv[i + 1];
|
||||
options.game_arguments_length = argc - i - 1;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user