Intercept event precondition errors
Pathoschild opened this issue ยท 2 comments
When an event key is invalid, GameLocation.checkEventPrecondition
throws an exception and crashes the game. This isn't uncommon, due to mods adding custom events.
Patch the method to catch exceptions, log an error, and return false (similar to StardewModdingAPI.Patches.DialogueErrorPatch
).
Repro steps:
- Install SMAPI and Content Patcher.
- Install this content pack.
- Load any save and leave the farmhouse. An error occurs.
Done in develop
for the upcoming SMAPI 3.0, thanks to @berkayylmao!