spelunky-fyi / overlunky

An overlay for Spelunky 2 to help you with modding, exploring the depths of the game and practicing with tools like spawning arbitrary items, warping to levels and teleporting.
MIT License
86 stars 32 forks source link

Move ON.SAVE callbacks to run last. #299

Closed gmjosack closed 1 year ago

gmjosack commented 1 year ago

Currently if you call save_script or save_progress from a callback that runs after ON.SAVE it will update your last_save time but not actually run the ON.SAVE callback.

This moves ON.SAVE callbacks into their own vector that always run last so manual saves work from any other callbacks.

gmjosack commented 1 year ago

I don't currently have an OL environment setup so I haven't tested this but wanted to get it up for feedback if it's the right approach.

also noticed we weren't clearing load_callbacks in clear_all_callbacks so I added that as well