diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-08 01:57:07 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-08 01:57:07 -0400 |
commit | 72a0b4fc6d268c67c3fba171793d5864f9710276 (patch) | |
tree | f7495b737b0865f7c5fa7edfb915d15a0e6ff741 | |
parent | 624840efe5f3d4135dafeb2939b182cfeb4ec6c3 (diff) | |
download | SMAPI-72a0b4fc6d268c67c3fba171793d5864f9710276.tar.gz SMAPI-72a0b4fc6d268c67c3fba171793d5864f9710276.tar.bz2 SMAPI-72a0b4fc6d268c67c3fba171793d5864f9710276.zip |
detect unrecoverable draw errors (#283)
-rw-r--r-- | release-notes.md | 9 | ||||
-rw-r--r-- | src/StardewModdingAPI/Framework/SGame.cs | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/release-notes.md b/release-notes.md index af535895..78b83806 100644 --- a/release-notes.md +++ b/release-notes.md @@ -10,6 +10,15 @@ For mod developers: images). --> +## 1.13 +See [log](https://github.com/Pathoschild/SMAPI/compare/1.12...1.13). + +For players: +* SMAPI now has better draw error recovery and detects when the error is irrecoverable. + +For mod developers: +* SMAPI now logs basic context info to simplify troubleshooting. + ## 1.12 See [log](https://github.com/Pathoschild/SMAPI/compare/1.11...1.12). diff --git a/src/StardewModdingAPI/Framework/SGame.cs b/src/StardewModdingAPI/Framework/SGame.cs index 7dae937b..6932af2a 100644 --- a/src/StardewModdingAPI/Framework/SGame.cs +++ b/src/StardewModdingAPI/Framework/SGame.cs @@ -967,6 +967,13 @@ namespace StardewModdingAPI.Framework } this.FailedDraws++; + // abort in known unrecoverable cases + if (Game1.toolSpriteSheet?.IsDisposed == true) + { + this.Monitor.ExitGameImmediately("the game unexpectedly disposed the tool spritesheet, so it crashed trying to draw a tool. This is a known bug in Stardew Valley 1.2.29, and there's no way to recover from it."); + return; + } + // recover sprite batch try { |