summaryrefslogtreecommitdiff
path: root/src/SMAPI/Patches/LoadContextPatch.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-07-12 20:01:38 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-13 16:13:38 -0400
commit6285c7954843557eec06cbae406c8ae436512803 (patch)
tree4724828b80e4cc29cf84a38e3ce80156de4347fe /src/SMAPI/Patches/LoadContextPatch.cs
parentb02c5459e19b2ac37b13a9d011dd20ea9a5fe922 (diff)
downloadSMAPI-6285c7954843557eec06cbae406c8ae436512803.tar.gz
SMAPI-6285c7954843557eec06cbae406c8ae436512803.tar.bz2
SMAPI-6285c7954843557eec06cbae406c8ae436512803.zip
prevent mods from crashing the game with invalid dialogue in more cases
Diffstat (limited to 'src/SMAPI/Patches/LoadContextPatch.cs')
-rw-r--r--src/SMAPI/Patches/LoadContextPatch.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/SMAPI/Patches/LoadContextPatch.cs b/src/SMAPI/Patches/LoadContextPatch.cs
index 43e09573..3f86c9a9 100644
--- a/src/SMAPI/Patches/LoadContextPatch.cs
+++ b/src/SMAPI/Patches/LoadContextPatch.cs
@@ -55,8 +55,8 @@ namespace StardewModdingAPI.Patches
{
harmony.Patch(
original: AccessTools.Method(typeof(Game1), nameof(Game1.loadForNewGame)),
- prefix: new HarmonyMethod(this.GetType(), nameof(LoadContextPatch.Prefix)),
- postfix: new HarmonyMethod(this.GetType(), nameof(LoadContextPatch.Postfix))
+ prefix: new HarmonyMethod(this.GetType(), nameof(LoadContextPatch.Before_Game1_LoadForNewGame)),
+ postfix: new HarmonyMethod(this.GetType(), nameof(LoadContextPatch.After_Game1_LoadForNewGame))
);
}
@@ -67,7 +67,7 @@ namespace StardewModdingAPI.Patches
/// <summary>The method to call instead of <see cref="Game1.loadForNewGame"/>.</summary>
/// <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>
- private static bool Prefix()
+ private static bool Before_Game1_LoadForNewGame()
{
LoadContextPatch.IsCreating = Game1.activeClickableMenu is TitleMenu menu && LoadContextPatch.Reflection.GetField<bool>(menu, "transitioningCharacterCreationMenu").GetValue();
LoadContextPatch.TimesLocationsCleared = 0;
@@ -83,7 +83,7 @@ namespace StardewModdingAPI.Patches
/// <summary>The method to call instead after <see cref="Game1.loadForNewGame"/>.</summary>
/// <remarks>This method must be static for Harmony to work correctly. See the Harmony documentation before renaming arguments.</remarks>
- private static void Postfix()
+ private static void After_Game1_LoadForNewGame()
{
if (LoadContextPatch.IsCreating)
{