EverestAPI / Everest

Everest - Celeste Mod Loader / Mod API
https://everestapi.github.io/
MIT License
369 stars 80 forks source link

Fix NPC sprite crash in `ResortMirror.BeforeRender` #842

Closed SnipUndercover closed 2 weeks ago

SnipUndercover commented 2 weeks ago

If there's a ResortMirror and an NPC in the Scene without the Sprite set (like HonlyHelper's PettableCat), the game will crash. This patch prevents this crash. It shouldn't happen in vanilla anyway.

The IL patch changes the condition in ResortMirror.BeforeRender in this fashion:

-if (NPC != null)
+if (NPC != null && NPC.Sprite != null)

Here's a screenshot of the relevant section post-patch: Patched ResortMirror.BeforeRender which shows that the patch has been applied successfully