Skip to content

Commit

Permalink
Bigfix
Browse files Browse the repository at this point in the history
- new directory functions didn't work correctly because of relative exe path
  • Loading branch information
cech12 committed May 17, 2019
1 parent f0fe234 commit 7332c55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class Mod : IToolTipDisplayer, IComparable
{
public string ModDirectoryName { get; private set; }

public string ModDirectoryPath { get; private set; }

public DirectoryInfo ModDirectoryInfo { get; private set; }

public ModConfig Config { get; private set; }
Expand All @@ -32,8 +30,8 @@ public class Mod : IToolTipDisplayer, IComparable
public Mod(string modDirectory, Dictionary<string, object> oldSettings)
{
ModDirectoryName = modDirectory;
ModDirectoryPath = Paths.ModPath + "\\" + Paths.ModDirectoryName + "\\" + ModDirectoryName + "\\";
ModDirectoryInfo = new DirectoryInfo(ModDirectoryPath);
// the last backslash is important for path cutting!
ModDirectoryInfo = new DirectoryInfo(Paths.ModPath + "\\" + Paths.ModDirectoryName + "\\" + ModDirectoryName + "\\");
FileCount = ModDirectoryInfo.GetFiles("*", SearchOption.AllDirectories).Length;

//get description
Expand Down
2 changes: 1 addition & 1 deletion Service/ModdingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public int LetsMod(Mod mod, DirectoryInfo modDirectory, DirectoryInfo gameDirect
//check for mod directories, that are handled in a different way
if (mod.Config.Directories.Count > 0)
{
var relativePath = modDir.FullName.Replace(mod.ModDirectoryPath, "");
var relativePath = modDir.FullName.Replace(mod.ModDirectoryInfo.FullName, "");
//replace all backslashes with slashes
relativePath = relativePath.Replace("\\", "/");
var skipDirectory = false;
Expand Down

0 comments on commit 7332c55

Please sign in to comment.