/// <summary> /// GetNotePosition() throws FatalEngineExecutionError when patched. /// Mimics ShouldNoteAppearInArea() using a static position in place of GetNotePosition(). /// </summary> public static bool ShouldNoteAppearInArea_Prefix(CommunityCenter __instance, ref bool __result, int area) { try { if (Bundles.IsCommunityCentreComplete() && Bundles.IsAbandonedJojaMartBundleAvailable() && (Game1.netWorldState.Value.BundleData.Keys.Any(key => key.StartsWith(Bundles.CommunityCentreAreaName)))) { Log.D($"ShouldNoteAppearInArea removing custom bundle data.", ModEntry.Instance.Config.DebugMode); Bundles.SaveAndUnloadBundleData(); } if (area != Bundles.CommunityCentreAreaNumber) { return(true); } __result = !Bundles.IsCommunityCentreKitchenComplete() && __instance.numberOfCompleteBundles() > (ModEntry.Instance.Config.DebugMode ? 0 : 2); return(false); } catch (ArgumentOutOfRangeException e) { Log.D($"Error in {nameof(ShouldNoteAppearInArea_Prefix)}, may be non-critical:\n{e}", ModEntry.Instance.Config.DebugMode); return(false); } catch (Exception e) { Log.E($"Error in {nameof(ShouldNoteAppearInArea_Prefix)}:\n{e}"); } return(true); }