diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-21 16:38:23 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-21 16:38:23 -0400 |
commit | 75f3600ab1eae06463ae8f386c5ab71f3815142f (patch) | |
tree | 5bff95c0446b9e70a06c1525fa7387b21ff148cc /src/SMAPI.Mods.ErrorHandler/Patches | |
parent | fc5fc54ab1c375e20b3e4f947bb11f08b4983bd1 (diff) | |
parent | 74215e844ae2af0075e5df3ab6a5f58efff4f981 (diff) | |
download | SMAPI-75f3600ab1eae06463ae8f386c5ab71f3815142f.tar.gz SMAPI-75f3600ab1eae06463ae8f386c5ab71f3815142f.tar.bz2 SMAPI-75f3600ab1eae06463ae8f386c5ab71f3815142f.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler/Patches')
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs index 95e4f5ef..8056fd71 100644 --- a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs +++ b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs @@ -27,11 +27,9 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches #endif { harmony.Patch( -#if SMAPI_FOR_WINDOWS - original: AccessTools.Method(typeof(SpriteBatch), "InternalDraw"), -#else - original: AccessTools.Method(typeof(SpriteBatch), "CheckValid", new[] { typeof(Texture2D) }), -#endif + original: Constants.GameFramework == GameFramework.Xna + ? AccessTools.Method(typeof(SpriteBatch), "InternalDraw") + : AccessTools.Method(typeof(SpriteBatch), "CheckValid", new[] { typeof(Texture2D) }), postfix: new HarmonyMethod(this.GetType(), nameof(SpriteBatchValidationPatches.After_SpriteBatch_CheckValid)) ); } @@ -40,7 +38,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches /********* ** Private methods *********/ -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA /// <summary>The method to call instead of <see cref="SpriteBatch.InternalDraw"/>.</summary> /// <param name="texture">The texture to validate.</param> #else |