Skip to content

Commit

Permalink
[Globals] HMM: get game directory from process
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx committed Mar 21, 2024
1 parent a80d947 commit 9ca8272
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Globals/Libraries/HMM.hmm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ Library "HMM" by "Hyper"

using Microsoft.Win32;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;

public string GetGameDirectory()
{
return Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
}

public Dictionary<string, Dictionary<string, string>> GetModsDatabase()
{
string cpkredirCfgPath = Path.Combine(RegistryConfig.LastGameDirectory, "cpkredir.ini");
string cpkredirCfgPath = Path.Combine(GetGameDirectory(), "cpkredir.ini");

if (!File.Exists(cpkredirCfgPath))
return new();
Expand Down

1 comment on commit 9ca8272

@hyperbx
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit fixes issue #135.

Please sign in to comment.