summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI')
-rw-r--r--src/StardewModdingAPI/Framework/SGame.cs7
1 files changed, 7 insertions, 0 deletions
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
{