summaryrefslogtreecommitdiff
path: root/src/SMAPI/Patches
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-12-21 12:25:27 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-12-21 12:25:27 -0500
commit71284e7176c55f66754470b19fd74b5b1fda4964 (patch)
tree848a7ec8c99e0e1f8335fac41f9e417dc1c86e40 /src/SMAPI/Patches
parent85b947dced10f5398055af36b5fdb6b8d32a6a6b (diff)
parent872a1d5627f20faece618644db1ae4749e124741 (diff)
downloadSMAPI-71284e7176c55f66754470b19fd74b5b1fda4964.tar.gz
SMAPI-71284e7176c55f66754470b19fd74b5b1fda4964.tar.bz2
SMAPI-71284e7176c55f66754470b19fd74b5b1fda4964.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Patches')
-rw-r--r--src/SMAPI/Patches/DialogueErrorPatch.cs4
-rw-r--r--src/SMAPI/Patches/ScheduleErrorPatch.cs2
2 files changed, 2 insertions, 4 deletions
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<List<string>> dialogues = DialogueErrorPatch.Reflection.GetField<List<string>>(__instance, "dialogues");
// replicate base constructor
- if (dialogues.GetValue() == null)
- dialogues.SetValue(new List<string>());
+ __instance.dialogues ??= new List<string>();
// 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