Don't autosave immediately after purchasing from a shop#2079
Don't autosave immediately after purchasing from a shop#2079dcvz merged 6 commits intoHarbourMasters:developfrom
Conversation
|
so this completely disables autosave when purchasing from shops? or just delays the autosave until the rupees have been taken. looking through the code it seems like it's the former. would it be possible to add an autosave call when the rupees finish getting taken? |
|
@briaguya-ai I can easily add an autosave call after the rupee decrement is finished since I need to fix the merge conflict I created for myself with my other PRs. Originally I didn't think it was too necessary since in most cases you'd be leaving the shop/grotto when you're finished and autosave would trigger then, but I think there are enough scrubs in big areas, especially with scrubsanity turned on, that it would still be useful. |
briaguya0
left a comment
There was a problem hiding this comment.
I wish this could be done without touching so many places, but i can't think of a simpler way to implement all the functionality.
Let's ![]()
There was a problem hiding this comment.
@briaguya-ai since we're modifying so many places now, I wonder if instead of using it explicitly for saving the current item we should instead make a generic hook like 'itemWillBeGiven' or some better name. Allowing us a general API for hooking into some game actions.
|
Won't block this merge on this though.. will give it more thought in the background |
Players have found that there exists a moment in time between when an item is purchased and when it's actually paid for where autosave will kick in, and if the game is reset in between that time, then they'll get to keep the item without needing to pay for it. This fix prevents that by deferring autosave after purchasing items from shops until the rupee decrement is complete.
To do that, the pending sale item is stored in the save file, and autosave checks to see if there's a pending sale before it triggers.
After the rupee decrement is finished, autosave is called again, although it still follows whatever settings have been chosen as to whether or not it will save after obtaining a particular type of item. Closes #1823
Build Artifacts