diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-04-26 18:25:59 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-04-26 18:25:59 -0400 |
commit | 0cf15d36d9e6f5a40a16e17f3bd3d53682fe648c (patch) | |
tree | 5aaf4d8cc82b2da36132a332e55a70e876d2c8d0 /src/StardewModdingAPI/Framework/SGame.cs | |
parent | 971bfd32d2f44d2fa1795807ce1ba1b700ff4f86 (diff) | |
download | SMAPI-0cf15d36d9e6f5a40a16e17f3bd3d53682fe648c.tar.gz SMAPI-0cf15d36d9e6f5a40a16e17f3bd3d53682fe648c.tar.bz2 SMAPI-0cf15d36d9e6f5a40a16e17f3bd3d53682fe648c.zip |
revamp 'exit immediately' to abort ongoing SMAPI tasks
Diffstat (limited to 'src/StardewModdingAPI/Framework/SGame.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/SGame.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/SGame.cs b/src/StardewModdingAPI/Framework/SGame.cs index 61493e87..e7c07889 100644 --- a/src/StardewModdingAPI/Framework/SGame.cs +++ b/src/StardewModdingAPI/Framework/SGame.cs @@ -200,6 +200,13 @@ namespace StardewModdingAPI.Framework /// <param name="gameTime">A snapshot of the game timing state.</param> protected override void Update(GameTime gameTime) { + // SMAPI exiting, stop processing game updates + if (this.Monitor.IsExiting) + { + this.Monitor.Log("SMAPI shutting down: aborting update.", LogLevel.Trace); + return; + } + // While a background new-day task is in progress, the game skips its own update logic // and defers to the XNA Update method. Running mod code in parallel to the background // update is risky, because data changes can conflict (e.g. collection changed during |