From 95e519796773a2ef17ec482e27cd4403282e2cd1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 11 Mar 2017 17:28:39 -0500 Subject: fix SaveEvents.AfterLoad being raised during the new-game intro before the player is initialised --- release-notes.md | 1 + src/StardewModdingAPI/Framework/SGame.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/release-notes.md b/release-notes.md index 22df8f70..96e6439a 100644 --- a/release-notes.md +++ b/release-notes.md @@ -36,6 +36,7 @@ For mod developers: * SMAPI now writes XNA input enums (`Buttons` and `Keys`) to JSON as strings automatically, so mods no longer need to add a `StringEnumConverter` themselves for those. * Logs now show the OS caption (like "Windows 10") instead of its internal version when available. * Logs now always use `\r\n` to simplify crossplatform viewing. +* Fixed `SaveEvents.AfterLoad` being raised during the new-game intro before the player is initialised. * Several obsolete APIs have been removed (see [deprecation guide](http://canimod.com/guides/updating-a-smapi-mod)), and all _notice_-level deprecations have been increased to _info_. * Deprecated the experimental `IConfigFile`. diff --git a/src/StardewModdingAPI/Framework/SGame.cs b/src/StardewModdingAPI/Framework/SGame.cs index 5edb103e..d551ff5b 100644 --- a/src/StardewModdingAPI/Framework/SGame.cs +++ b/src/StardewModdingAPI/Framework/SGame.cs @@ -1094,7 +1094,7 @@ namespace StardewModdingAPI.Framework } // save loaded event - if (Game1.hasLoadedGame && !SaveGame.IsProcessing/*still loading save*/ && this.AfterLoadTimer >= 0) + if (Constants.IsSaveLoaded && !SaveGame.IsProcessing/*still loading save*/ && this.AfterLoadTimer >= 0) { if (this.AfterLoadTimer == 0) { -- cgit