diff --git a/Stardew Valley Expanded/StardewValleyExpanded/HarmonyPatch_FarmComputerLocations.cs b/Stardew Valley Expanded/StardewValleyExpanded/HarmonyPatch_FarmComputerLocations.cs index f74b721..8aaf2e9 100644 --- a/Stardew Valley Expanded/StardewValleyExpanded/HarmonyPatch_FarmComputerLocations.cs +++ b/Stardew Valley Expanded/StardewValleyExpanded/HarmonyPatch_FarmComputerLocations.cs @@ -80,9 +80,13 @@ public static void ApplyPatch(Harmony harmony, IMonitor monitor) public static List GreenhouseLocations = ["Custom_GrandpasShedGreenhouse"]; /// Adds any extra farm locations' crops to this method's total. + /// The calling location instance. /// The result of the original method. - private static void Farm_getTotalCrops(ref int __result) + private static void Farm_getTotalCrops(GameLocation __instance, ref int __result) { + if (__instance is not Farm) + return; + try { foreach (string name in FarmLocations) // for each extra farm location @@ -114,9 +118,13 @@ private static void Farm_getTotalCrops(ref int __result) } /// Adds any extra farm locations' crops to this method's total. + /// The calling location instance. /// The result of the original method. - private static void Farm_getTotalCropsReadyForHarvest(ref int __result) + private static void Farm_getTotalCropsReadyForHarvest(GameLocation __instance, ref int __result) { + if (__instance is not Farm) + return; + try { foreach (string name in FarmLocations) // for each extra farm location @@ -148,9 +156,13 @@ private static void Farm_getTotalCropsReadyForHarvest(ref int __result) } /// Adds any extra farm locations' crops to this method's total. + /// The calling location instance. /// The result of the original method. - private static void Farm_getTotalUnwateredCrops(ref int __result) + private static void Farm_getTotalUnwateredCrops(GameLocation __instance, ref int __result) { + if (__instance is not Farm) + return; + try { foreach (string name in FarmLocations) // for each extra farm location @@ -182,9 +194,13 @@ private static void Farm_getTotalUnwateredCrops(ref int __result) } /// Adds any extra farm locations' crops to this method's total. + /// The calling location instance. /// The result of the original method. - private static void Farm_getTotalOpenHoeDirt(ref int __result) + private static void Farm_getTotalOpenHoeDirt(GameLocation __instance, ref int __result) { + if (__instance is not Farm) + return; + try { foreach (string name in FarmLocations) // for each extra farm location @@ -216,9 +232,13 @@ private static void Farm_getTotalOpenHoeDirt(ref int __result) } /// Adds any extra greenhouse locations' crops to this method's total. + /// The calling location instance. /// The result of the original method. - private static void Farm_getTotalGreenhouseCropsReadyForHarvest(ref int? __result) + private static void Farm_getTotalGreenhouseCropsReadyForHarvest(GameLocation __instance, ref int? __result) { + if (__instance is not Farm) + return; + try { foreach (string name in GreenhouseLocations) // for each extra greenhouse location