From 8019c6224cc26d75fa03741abe6bb8107fe0a730 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Fri, 7 Aug 2026 20:54:55 -0700 Subject: [PATCH] Make SeedShop.draw prefix conditional Apparently the Android platform does not have SeedShop.draw, so the harmony patch to prefix this function does not work. Fix this by making the patch conditional on the method. This is unlikely to be a complete fix for android compatibility as we are removing a possibly necessary patch with no alternative. However, this should be a step towards compatibility. Signed-off-by: Jacob Keller --- ModEntry.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ModEntry.cs b/ModEntry.cs index 5612e0a..18920f4 100644 --- a/ModEntry.cs +++ b/ModEntry.cs @@ -128,10 +128,15 @@ public override void Entry(IModHelper helper) postfix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.InventoryMenu_draw_Postfix)) ); - harmony.Patch( - original: AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw)), - prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix)) - ); + var seedShopDraw = AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw)); + if (seedShopDraw != null) { + harmony.Patch( + original: seedShopDraw, + prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix)) + ); + } else { + SMonitor.Log("SeedShop.draw method not found on this platform. SeedShop draw patch will not be applied.", LogLevel.Warn); + } harmony.Patch( original: AccessTools.Method(typeof(GameLocation), nameof(GameLocation.performAction), new Type[] { typeof(string[]), typeof(Farmer), typeof(Location) }),