fix LoadStage.SaveParsed raised before save data available
This commit is contained in:
parent
9240bdbf9b
commit
d8dd4b4c18
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue