summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-07 22:30:09 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-07 22:30:09 -0500
commitd8dd4b4c18f571c6e8a7264f0168a69fd04bce70 (patch)
treea0f52f0484565dd940cb67e3689e5843256e0106
parent9240bdbf9b6b54d820cb01953ceea31f5e06598e (diff)
downloadSMAPI-d8dd4b4c18f571c6e8a7264f0168a69fd04bce70.tar.gz
SMAPI-d8dd4b4c18f571c6e8a7264f0168a69fd04bce70.tar.bz2
SMAPI-d8dd4b4c18f571c6e8a7264f0168a69fd04bce70.zip
fix LoadStage.SaveParsed raised before save data available
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/SGame.cs4
2 files changed, 4 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index cde04226..9c3ff1c6 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -3,6 +3,7 @@
* For modders:
* Fixed `Constants.SaveFolderName` and `CurrentSavePath` not available during early load stages when using `Specialised.LoadStageChanged` event.
+ * Fixed `LoadStage.SaveParsed` raised before the parsed save data is available.
## 2.10.1
Released 30 December 2018 for Stardew Valley 1.3.32.
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 6aff6c01..a90e8264 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -290,6 +290,7 @@ namespace StardewModdingAPI.Framework
// Run async tasks synchronously to avoid issues due to mod events triggering
// concurrently with game code.
+ bool saveParsed = false;
if (Game1.currentLoader != null)
{
this.Monitor.Log("Game loader synchronising...", LogLevel.Trace);
@@ -298,7 +299,8 @@ namespace StardewModdingAPI.Framework
// raise load stage changed
switch (Game1.currentLoader.Current)
{
- case 20:
+ case 20 when (!saveParsed && SaveGame.loaded != null):
+ saveParsed = true;
this.OnLoadStageChanged(LoadStage.SaveParsed);
break;