diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-04-27 16:30:41 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-04-27 16:30:41 -0400 |
commit | df6e745c6b842290338317ed1d3e969ee222998c (patch) | |
tree | 4b8b28ddd7d8b9fe381bc7902f7c19187a61d4be /src/SMAPI/Patches/DialogueErrorPatch.cs | |
parent | d0dad43e243864eb8bfdf46c853c5c7fba7c55ed (diff) | |
parent | f44151dbb47b82250955be7c25145d1774bec705 (diff) | |
download | SMAPI-df6e745c6b842290338317ed1d3e969ee222998c.tar.gz SMAPI-df6e745c6b842290338317ed1d3e969ee222998c.tar.bz2 SMAPI-df6e745c6b842290338317ed1d3e969ee222998c.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Patches/DialogueErrorPatch.cs')
-rw-r--r-- | src/SMAPI/Patches/DialogueErrorPatch.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/SMAPI/Patches/DialogueErrorPatch.cs b/src/SMAPI/Patches/DialogueErrorPatch.cs index 24f97259..1e49826d 100644 --- a/src/SMAPI/Patches/DialogueErrorPatch.cs +++ b/src/SMAPI/Patches/DialogueErrorPatch.cs @@ -24,9 +24,6 @@ namespace StardewModdingAPI.Patches /// <summary>Simplifies access to private code.</summary> private static Reflector Reflection; - /// <summary>Whether the <see cref="NPC.CurrentDialogue"/> getter is currently being intercepted.</summary> - private static bool IsInterceptingCurrentDialogue; - /********* ** Accessors @@ -112,12 +109,12 @@ namespace StardewModdingAPI.Patches /// <returns>Returns whether to execute the original method.</returns> private static bool Before_NPC_CurrentDialogue(NPC __instance, ref Stack<Dialogue> __result, MethodInfo __originalMethod) { - if (DialogueErrorPatch.IsInterceptingCurrentDialogue) + const string key = nameof(Before_NPC_CurrentDialogue); + if (!PatchHelper.StartIntercept(key)) return true; try { - DialogueErrorPatch.IsInterceptingCurrentDialogue = true; __result = (Stack<Dialogue>)__originalMethod.Invoke(__instance, new object[0]); return false; } @@ -129,7 +126,7 @@ namespace StardewModdingAPI.Patches } finally { - DialogueErrorPatch.IsInterceptingCurrentDialogue = false; + PatchHelper.StopIntercept(key); } } } |