From 7eee2158a0629396baef8fc36a1cbcbc929becef Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Nov 2016 01:09:51 -0500 Subject: fix an initialisation error when a Windows user has both "StardewValley.exe" and "Stardew Valley.exe" in their game directory --- src/StardewModdingAPI/Program.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/StardewModdingAPI') diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 989b2abd..e66abb25 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -23,9 +23,11 @@ namespace StardewModdingAPI ** Properties *********/ /// The full path to the Stardew Valley executable. - private static readonly string GameExecutablePath = File.Exists(Path.Combine(Constants.ExecutionPath, "StardewValley.exe")) - ? Path.Combine(Constants.ExecutionPath, "StardewValley.exe") // Linux or Mac - : Path.Combine(Constants.ExecutionPath, "Stardew Valley.exe"); // Windows +#if SMAPI_FOR_WINDOWS + private static readonly string GameExecutablePath = Path.Combine(Constants.ExecutionPath, "Stardew Valley.exe"); +#else + private static readonly string GameExecutablePath = Path.Combine(Constants.ExecutionPath, "StardewValley.exe"); +#endif /// The full path to the folder containing mods. private static readonly string ModPath = Path.Combine(Constants.ExecutionPath, "Mods"); -- cgit