Skip to content

Commit 7b815c0

Browse files
committed
Fix LocalFinder failing with 1-click install (thanks, loudur!)
1 parent 707af27 commit 7b815c0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
// You can specify all the values or you can default the Build and Revision Numbers
3535
// by using the '*' as shown below:
3636
// [assembly: AssemblyVersion("1.0.*")]
37-
[assembly: AssemblyVersion("18.05.4.*")]
37+
[assembly: AssemblyVersion("18.05.5.*")]
3838
[assembly: AssemblyFileVersion("1.0.0.0")]

src/Finders/LocalFinder.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.IO;
66
using System.Linq;
7+
using System.Reflection;
78
using System.Text;
89
using System.Text.RegularExpressions;
910

@@ -14,8 +15,10 @@ public class LocalFinder : GameFinder {
1415
public override int Priority => -1000;
1516

1617
public override string FindGameDir(string gameid) {
17-
string path = Environment.CurrentDirectory;
18-
if (File.Exists(Path.Combine(path, gameid)))
18+
string path;
19+
if (File.Exists(Path.Combine(path = Environment.CurrentDirectory, gameid)))
20+
return path;
21+
if (File.Exists(Path.Combine(path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), gameid)))
1922
return path;
2023
return null;
2124
}

src/GameModder.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ public void Uninstall() {
123123
public void DownloadMod(string url) {
124124
Console.WriteLine("Starting mod download");
125125

126-
while (string.IsNullOrEmpty(Info.CurrentGamePath))
127-
Thread.Sleep(100);
128-
129126
Uri uri = new Uri(url);
130127

131128
string modRoot = Info.ModsDir;

0 commit comments

Comments
 (0)