Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ private static string GetGameExecutablePath(string suffix)
if (suffix == ".exe")
{
// Get the path of the currently running executable
#if !ENABLE_IL2CPP
// Process.MainModule is only supported in Mono builds, not in IL2CPP, and will cause a crash
try
{
var process = System.Diagnostics.Process.GetCurrentProcess();
Expand All @@ -291,6 +293,7 @@ private static string GetGameExecutablePath(string suffix)
{
PassportLogger.Warn($"Process inaccessible: {ex.Message}. Using fallback method.");
}
#endif

// Fallback: Use command line args
var args = System.Environment.GetCommandLineArgs();
Expand Down
Loading