diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-31 23:18:49 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-31 23:18:49 -0400 |
commit | 7992b52f035be5c6229ff0912bfd91084d41d5dc (patch) | |
tree | 4a1333b6d41639c17124a84d080b82978c36b8bb /src | |
parent | 17acf248b66861217d48826e77f24cc311b4a22e (diff) | |
download | SMAPI-7992b52f035be5c6229ff0912bfd91084d41d5dc.tar.gz SMAPI-7992b52f035be5c6229ff0912bfd91084d41d5dc.tar.bz2 SMAPI-7992b52f035be5c6229ff0912bfd91084d41d5dc.zip |
fix AfterDayStarted event being raised during the new-game intro (#332)
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI/Framework/SGame.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Framework/SGame.cs b/src/StardewModdingAPI/Framework/SGame.cs index d6f1a05b..bec6538b 100644 --- a/src/StardewModdingAPI/Framework/SGame.cs +++ b/src/StardewModdingAPI/Framework/SGame.cs @@ -19,7 +19,6 @@ using StardewValley.Menus; using StardewValley.Tools; using xTile.Dimensions; using xTile.Layers; -using SFarmer = StardewValley.Farmer; namespace StardewModdingAPI.Framework { @@ -318,6 +317,11 @@ namespace StardewModdingAPI.Framework *********/ if (Context.IsSaveLoaded && !SaveGame.IsProcessing /*still loading save*/ && this.AfterLoadTimer >= 0) { +#if !SMAPI_1_x + if (Game1.dayOfMonth != 0) // wait until new-game intro finishes (world not fully initialised yet) +#endif + this.AfterLoadTimer--; + if (this.AfterLoadTimer == 0) { this.Monitor.Log($"Context: loaded saved game '{Constants.SaveFolderName}', starting {Game1.currentSeason} {Game1.dayOfMonth} Y{Game1.year}.", LogLevel.Trace); @@ -329,7 +333,6 @@ namespace StardewModdingAPI.Framework #endif TimeEvents.InvokeAfterDayStarted(this.Monitor); } - this.AfterLoadTimer--; } /********* |