diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-04 01:27:21 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-04 01:27:21 -0400 |
commit | c8ae8c2b0021401783ac38a80db7e676674f623a (patch) | |
tree | 94577de61106754aef24b276711112acc1152fc3 | |
parent | b36566f08d15561557636737c39c8a5d57d74496 (diff) | |
download | SMAPI-c8ae8c2b0021401783ac38a80db7e676674f623a.tar.gz SMAPI-c8ae8c2b0021401783ac38a80db7e676674f623a.tar.bz2 SMAPI-c8ae8c2b0021401783ac38a80db7e676674f623a.zip |
load game synchronously to fix asset loader/editor errors
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Framework/SGame.cs | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 551dd1d5..85776a06 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -14,6 +14,7 @@ * Added `Context.IsMultiplayer` and `Context.IsMainPlayer` flags. * Added `Constants.TargetPlatform` which says whether the game is running on Linux, Mac, or Windows. * Added `semanticVersion.IsPrerelease()` method. + * Fixed error if a mod loads a PNG while the game is loading (e.g. custom map tilesheets via `IAssetLoader`). * Fixed assets loaded by temporary content managers not being editable by mods. * Fixed assets not reloaded consistently when the player switches language. * Fixed console command input not saved to the log. diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 767b49c7..78d07fbf 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -219,6 +219,20 @@ namespace StardewModdingAPI.Framework inputState.TrueUpdate(); /********* + ** Load game synchronously + *********/ + if (Game1.gameMode == Game1.loadingMode) + { + this.Monitor.Log("Running game loader...", LogLevel.Trace); + while (Game1.gameMode == Game1.loadingMode) + { + base.Update(gameTime); + this.Events.Specialised_UnvalidatedUpdateTick.Raise(); + } + this.Monitor.Log("Game loader OK.", LogLevel.Trace); + } + + /********* ** Skip conditions *********/ // SMAPI exiting, stop processing game updates |