diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-17 20:36:32 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-21 16:06:52 -0400 |
commit | ca67dcc920560f3fd19a4531c40fdb03d19e96c5 (patch) | |
tree | 4ad4a7966f8d617251fce731b6c14d41e9a313e1 /src/SMAPI.Mods.ErrorHandler/Patches | |
parent | 73321eceb96f263f10857667d7b3726a5098e770 (diff) | |
download | SMAPI-ca67dcc920560f3fd19a4531c40fdb03d19e96c5.tar.gz SMAPI-ca67dcc920560f3fd19a4531c40fdb03d19e96c5.tar.bz2 SMAPI-ca67dcc920560f3fd19a4531c40fdb03d19e96c5.zip |
add Constants.GameFramework field (#767)
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler/Patches')
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs index f605b2ce..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_XNA - 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)) ); } |