summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-07-30 00:34:53 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-07-30 00:34:53 -0400
commitaa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f (patch)
treefaccc161af30557a38c80d266f257124af068af7 /src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs
parent737a434ad6704d22776f463c192b9a9748ce2a21 (diff)
downloadSMAPI-aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f.tar.gz
SMAPI-aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f.tar.bz2
SMAPI-aa65b2e2f6ae2578f9d1f81d6fc1f4c5a261d90f.zip
split patch classes which target multiple types
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs')
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs b/src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs
index a065e3d7..ca5bb0bf 100644
--- a/src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs
+++ b/src/SMAPI.Mods.ErrorHandler/Patches/DialogueErrorPatch.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using HarmonyLib;
using StardewModdingAPI.Framework;
@@ -43,10 +42,6 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
original: AccessTools.Constructor(typeof(Dialogue), new[] { typeof(string), typeof(NPC) }),
finalizer: new HarmonyMethod(this.GetType(), nameof(DialogueErrorPatch.Finalize_Dialogue_Constructor))
);
- harmony.Patch(
- original: AccessTools.Property(typeof(NPC), nameof(NPC.CurrentDialogue)).GetMethod,
- finalizer: new HarmonyMethod(this.GetType(), nameof(DialogueErrorPatch.Finalize_NPC_CurrentDialogue))
- );
}
@@ -76,21 +71,5 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
return null;
}
-
- /// <summary>The method to call after <see cref="NPC.CurrentDialogue"/>.</summary>
- /// <param name="__instance">The instance being patched.</param>
- /// <param name="__result">The return value of the original method.</param>
- /// <param name="__exception">The exception thrown by the wrapped method, if any.</param>
- /// <returns>Returns the exception to throw, if any.</returns>
- private static Exception Finalize_NPC_CurrentDialogue(NPC __instance, ref Stack<Dialogue> __result, Exception __exception)
- {
- if (__exception == null)
- return null;
-
- DialogueErrorPatch.MonitorForGame.Log($"Failed loading current dialogue for NPC {__instance.Name}:\n{__exception.GetLogSummary()}", LogLevel.Error);
- __result = new Stack<Dialogue>();
-
- return null;
- }
}
}