SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Intercept event precondition errors

Pathoschild opened this issue ยท 2 comments

commented

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).

commented

Repro steps:

  1. Install SMAPI and Content Patcher.
  2. Install this content pack.
  3. Load any save and leave the farmhouse. An error occurs.
commented

Done in develop for the upcoming SMAPI 3.0, thanks to @berkayylmao!