From ffe74869ca626883f3f65116fd19af2d4951156e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 20 Dec 2020 22:34:59 -0500 Subject: update patches and asset propagation --- src/SMAPI/Patches/DialogueErrorPatch.cs | 4 +--- src/SMAPI/Patches/ScheduleErrorPatch.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/SMAPI/Patches') diff --git a/src/SMAPI/Patches/DialogueErrorPatch.cs b/src/SMAPI/Patches/DialogueErrorPatch.cs index 42494390..215df561 100644 --- a/src/SMAPI/Patches/DialogueErrorPatch.cs +++ b/src/SMAPI/Patches/DialogueErrorPatch.cs @@ -135,11 +135,9 @@ namespace StardewModdingAPI.Patches IReflectedMethod translateArraysOfStrings = DialogueErrorPatch.Reflection.GetMethod(typeof(Dialogue), "TranslateArraysOfStrings"); IReflectedMethod parseDialogueString = DialogueErrorPatch.Reflection.GetMethod(__instance, "parseDialogueString"); IReflectedMethod checkForSpecialDialogueAttributes = DialogueErrorPatch.Reflection.GetMethod(__instance, "checkForSpecialDialogueAttributes"); - IReflectedField> dialogues = DialogueErrorPatch.Reflection.GetField>(__instance, "dialogues"); // replicate base constructor - if (dialogues.GetValue() == null) - dialogues.SetValue(new List()); + __instance.dialogues ??= new List(); // duplicate code with try..catch try diff --git a/src/SMAPI/Patches/ScheduleErrorPatch.cs b/src/SMAPI/Patches/ScheduleErrorPatch.cs index 17db07a6..1d58a292 100644 --- a/src/SMAPI/Patches/ScheduleErrorPatch.cs +++ b/src/SMAPI/Patches/ScheduleErrorPatch.cs @@ -51,7 +51,7 @@ namespace StardewModdingAPI.Patches #endif { harmony.Patch( - original: AccessTools.Method(typeof(NPC), "parseMasterSchedule"), + original: AccessTools.Method(typeof(NPC), nameof(NPC.parseMasterSchedule)), #if HARMONY_2 finalizer: new HarmonyMethod(this.GetType(), nameof(ScheduleErrorPatch.Finalize_NPC_parseMasterSchedule)) #else -- cgit