Skip to content

Commit 759705c

Browse files
authored
Merge pull request #86 from Blackheart595/master
Fix working directory for Vanilla launch option
2 parents 97cc76f + 5193194 commit 759705c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Universal THCRAP Launcher/MainForm.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,13 +1444,14 @@ private void StartThcrap()
14441444
{
14451445
_displayNameToThxxDictionary.TryGetValue(gameListBox.SelectedItem.ToString().Replace("★", "").Trim(), out string s1);
14461446
_gamesDictionary.TryGetValue(s1 ?? throw new InvalidOperationException(), out string game);
1447+
String gameDirectory = game.Substring(0, game.LastIndexOf('/'));
14471448
id = s1;
14481449
if (game == null)
14491450
{
14501451
ErrorAndExit(I18N.LangResource.errors.oops?.ToString());
14511452
return;
14521453
}
1453-
process = new Process { StartInfo = { FileName = game, RedirectStandardOutput = true, UseShellExecute = false } };
1454+
process = new Process { StartInfo = { FileName = game, WorkingDirectory = gameDirectory, RedirectStandardOutput = true, UseShellExecute = false } };
14541455
process.OutputDataReceived += Process_OutputDataReceived;
14551456
log.WriteLine($"Game {game} started without thcrap.");
14561457
}

0 commit comments

Comments
 (0)