summaryrefslogtreecommitdiff
path: root/src/SMAPI/Patches/EventErrorPatch.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-04-27 16:30:41 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-04-27 16:30:41 -0400
commitdf6e745c6b842290338317ed1d3e969ee222998c (patch)
tree4b8b28ddd7d8b9fe381bc7902f7c19187a61d4be /src/SMAPI/Patches/EventErrorPatch.cs
parentd0dad43e243864eb8bfdf46c853c5c7fba7c55ed (diff)
parentf44151dbb47b82250955be7c25145d1774bec705 (diff)
downloadSMAPI-df6e745c6b842290338317ed1d3e969ee222998c.tar.gz
SMAPI-df6e745c6b842290338317ed1d3e969ee222998c.tar.bz2
SMAPI-df6e745c6b842290338317ed1d3e969ee222998c.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Patches/EventErrorPatch.cs')
-rw-r--r--src/SMAPI/Patches/EventErrorPatch.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/SMAPI/Patches/EventErrorPatch.cs b/src/SMAPI/Patches/EventErrorPatch.cs
index 1dc7e8c3..504d1d2e 100644
--- a/src/SMAPI/Patches/EventErrorPatch.cs
+++ b/src/SMAPI/Patches/EventErrorPatch.cs
@@ -18,9 +18,6 @@ namespace StardewModdingAPI.Patches
/// <summary>Writes messages to the console and log file on behalf of the game.</summary>
private static IMonitor MonitorForGame;
- /// <summary>Whether the method is currently being intercepted.</summary>
- private static bool IsIntercepted;
-
/*********
** Accessors
@@ -61,12 +58,12 @@ namespace StardewModdingAPI.Patches
/// <returns>Returns whether to execute the original method.</returns>
private static bool Before_GameLocation_CheckEventPrecondition(GameLocation __instance, ref int __result, string precondition, MethodInfo __originalMethod)
{
- if (EventErrorPatch.IsIntercepted)
+ const string key = nameof(Before_GameLocation_CheckEventPrecondition);
+ if (!PatchHelper.StartIntercept(key))
return true;
try
{
- EventErrorPatch.IsIntercepted = true;
__result = (int)__originalMethod.Invoke(__instance, new object[] { precondition });
return false;
}
@@ -78,7 +75,7 @@ namespace StardewModdingAPI.Patches
}
finally
{
- EventErrorPatch.IsIntercepted = false;
+ PatchHelper.StopIntercept(key);
}
}
}