summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-01-19 21:13:23 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-01-19 21:13:23 -0500
commit568ba2757e0b2947a8578128ff8f0a70eb075b38 (patch)
tree196d64063fe2eeaa15e4ad25e33fc75f334a7563
parenta59572ee4eb64b075836247b92401c0fb554b6f0 (diff)
downloadSMAPI-568ba2757e0b2947a8578128ff8f0a70eb075b38.tar.gz
SMAPI-568ba2757e0b2947a8578128ff8f0a70eb075b38.tar.bz2
SMAPI-568ba2757e0b2947a8578128ff8f0a70eb075b38.zip
fix events being raised while the game is loading a save (#424)
-rw-r--r--docs/release-notes.md4
-rw-r--r--src/SMAPI/Framework/SGame.cs7
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index dd9f0352..d55ba5a1 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,15 +1,17 @@
# Release notes
## 2.4
* For players:
+ * Fixed graphical corruption in rare cases.
* Fixed error parsing `config.json` files containing curly quotes.
* Fixed error parsing JSON files generated on another platform.
- * Fixed rare issues caused by mods reloading core assemblies, which is no longer allowed.
+ * Fixed error parsing some JSON files after mods reload core assemblies, which is no longer allowed.
* For the [log parser][]:
* Fixed parse error for logs with zero installed mods.
* For modders:
* Added `SButton` `IsActionButton()` and `IsUseToolButton()` extensions.
+ * Fixed events being raised while the game is loading a save file.
* Fixed input events not recognising controller input as an action or use-tool button.
* Fixed input events setting the same `IsActionButton` and `IsUseToolButton` values for all buttons pressed in an update tick.
* Fixed semantic versions always ignoring `-0` tag.
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 4a17926c..2eb2da99 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -229,6 +229,13 @@ namespace StardewModdingAPI.Framework
return;
}
+ // game is asynchronously loading a save, block mod events to avoid conflicts
+ if (Game1.gameMode == Game1.loadingMode)
+ {
+ base.Update(gameTime);
+ return;
+ }
+
/*********
** Save events + suppress events during save
*********/