summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-16 23:42:00 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-16 23:42:00 -0400
commit4a7fb8bad2eabb215240e6a6d3febd1e91b3c2d5 (patch)
treeb69b9323c04516df2edfc70f11496069758c9fab /src/SMAPI
parent8c46590c6088bdc785ed2d21624b6bb60be6190c (diff)
downloadSMAPI-4a7fb8bad2eabb215240e6a6d3febd1e91b3c2d5.tar.gz
SMAPI-4a7fb8bad2eabb215240e6a6d3febd1e91b3c2d5.tar.bz2
SMAPI-4a7fb8bad2eabb215240e6a6d3febd1e91b3c2d5.zip
remove reflected access to Game1.version (which is no longer const)
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Constants.cs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs
index 820579b8..07557cd3 100644
--- a/src/SMAPI/Constants.cs
+++ b/src/SMAPI/Constants.cs
@@ -111,7 +111,7 @@ namespace StardewModdingAPI
internal static string ModsPath { get; set; }
/// <summary>The game's current semantic version.</summary>
- internal static ISemanticVersion GameVersion { get; } = new GameVersion(Constants.GetGameVersion());
+ internal static ISemanticVersion GameVersion { get; } = new GameVersion(Game1.version);
/// <summary>The target game platform.</summary>
internal static Platform Platform { get; } = EnvironmentUtility.DetectPlatform();
@@ -197,16 +197,6 @@ namespace StardewModdingAPI
/*********
** Private methods
*********/
- /// <summary>Get the game's current version string.</summary>
- private static string GetGameVersion()
- {
- // we need reflection because it's a constant, so SMAPI's references to it are inlined at compile-time
- FieldInfo field = typeof(Game1).GetField(nameof(Game1.version), BindingFlags.Public | BindingFlags.Static);
- if (field == null)
- throw new InvalidOperationException($"The {nameof(Game1)}.{nameof(Game1.version)} field could not be found.");
- return (string)field.GetValue(null);
- }
-
/// <summary>Get the name of the save folder, if any.</summary>
internal static string GetSaveFolderName()
{