summaryrefslogtreecommitdiff
path: root/src/SMAPI/Patches/DialogueErrorPatch.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-26 19:48:01 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-26 19:48:01 -0400
commit9461494a35b789c679a799fc9c5db2321d19d803 (patch)
treede8fd404dd81c0d6c57626b2cd8331a6c38c5f77 /src/SMAPI/Patches/DialogueErrorPatch.cs
parent1b5055dfaafc6dcf77b5262b8290e8ca2c8179ed (diff)
downloadSMAPI-9461494a35b789c679a799fc9c5db2321d19d803.tar.gz
SMAPI-9461494a35b789c679a799fc9c5db2321d19d803.tar.bz2
SMAPI-9461494a35b789c679a799fc9c5db2321d19d803.zip
auto-fix save data when a custom NPC mod is removed
Diffstat (limited to 'src/SMAPI/Patches/DialogueErrorPatch.cs')
-rw-r--r--src/SMAPI/Patches/DialogueErrorPatch.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/SMAPI/Patches/DialogueErrorPatch.cs b/src/SMAPI/Patches/DialogueErrorPatch.cs
index f1c25c05..24f97259 100644
--- a/src/SMAPI/Patches/DialogueErrorPatch.cs
+++ b/src/SMAPI/Patches/DialogueErrorPatch.cs
@@ -10,6 +10,9 @@ using StardewValley;
namespace StardewModdingAPI.Patches
{
/// <summary>A Harmony patch for the <see cref="Dialogue"/> constructor which intercepts invalid dialogue lines and logs an error instead of crashing.</summary>
+ /// <remarks>Patch methods must be static for Harmony to work correctly. See the Harmony documentation before renaming patch arguments.</remarks>
+ [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Argument names are defined by Harmony and methods are named for clarity.")]
+ [SuppressMessage("ReSharper", "IdentifierTypo", Justification = "Argument names are defined by Harmony and methods are named for clarity.")]
internal class DialogueErrorPatch : IHarmonyPatch
{
/*********
@@ -29,7 +32,7 @@ namespace StardewModdingAPI.Patches
** Accessors
*********/
/// <summary>A unique name for this patch.</summary>
- public string Name => $"{nameof(DialogueErrorPatch)}";
+ public string Name => nameof(DialogueErrorPatch);
/*********
@@ -68,8 +71,6 @@ namespace StardewModdingAPI.Patches
/// <param name="masterDialogue">The dialogue being parsed.</param>
/// <param name="speaker">The NPC for which the dialogue is being parsed.</param>
/// <returns>Returns whether to execute the original method.</returns>
- /// <remarks>This method must be static for Harmony to work correctly. See the Harmony documentation before renaming arguments.</remarks>
- [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Argument names are defined by Harmony.")]
private static bool Before_Dialogue_Constructor(Dialogue __instance, string masterDialogue, NPC speaker)
{
// get private members
@@ -109,8 +110,6 @@ namespace StardewModdingAPI.Patches
/// <param name="__result">The return value of the original method.</param>
/// <param name="__originalMethod">The method being wrapped.</param>
/// <returns>Returns whether to execute the original method.</returns>
- /// <remarks>This method must be static for Harmony to work correctly. See the Harmony documentation before renaming arguments.</remarks>
- [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Argument names are defined by Harmony.")]
private static bool Before_NPC_CurrentDialogue(NPC __instance, ref Stack<Dialogue> __result, MethodInfo __originalMethod)
{
if (DialogueErrorPatch.IsInterceptingCurrentDialogue)