fix various commandline argument related things

This commit is contained in:
Lion Kortlepel
2024-10-07 00:33:43 +02:00
parent 0eba745d4c
commit 7b59cb6f87
7 changed files with 42 additions and 20 deletions
+2 -2
View File
@@ -107,7 +107,7 @@ void StartGame(std::string Dir) {
void StartGame(std::string Dir) {
int status;
std::string filename = (Dir + "/BinLinux/BeamNG.drive.x64");
std::vector<char*> argv;
std::vector<const char*> argv;
argv.push_back(filename.data());
for (int i = 0; i < options.game_arguments_length; i++) {
argv.push_back(options.game_arguments[i]);
@@ -119,7 +119,7 @@ void StartGame(std::string Dir) {
posix_spawn_file_actions_init(&spawn_actions);
posix_spawn_file_actions_addclose(&spawn_actions, STDOUT_FILENO);
posix_spawn_file_actions_addclose(&spawn_actions, STDERR_FILENO);
int result = posix_spawn(&pid, filename.c_str(), &spawn_actions, nullptr, argv.data(), environ);
int result = posix_spawn(&pid, filename.c_str(), &spawn_actions, nullptr, const_cast<char**>(argv.data()), environ);
if (result != 0) {
error("Failed to Launch the game! launcher closing soon");