-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item_Give and OnReceiveItem updates #2580
Conversation
…ollowing changes: Reworked the references to it in `z_parameter` to call a single function with the item return and hook call in it for ease of editing. Modified the pendingSale functionality to set and pass a modIndex value as well, as mod items (like randomizer) in shops still use the vanilla sale path.
Also added Randomizer_Item_Give to the OnReceiveItem system.
As a side effect, item autosave doesn't work for shop/scrub/merchant transactions, requires new OnSaleEnded hook that can also call the autosave.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a first pass through, main thing that stands out to me is a couple places where we can avoid a call to ItemTable_ReceiveItem
Yeah, I feel pretty silly about all those unnecessary RetrieveEntry calls now, lol. No, there's no reason for them. |
…ry properties were being used to call it. General code cleanup.
…ale. Migrated AutoSave to its own function, registered AutoSave function to OnReceiveItem and OnSaleEnd hooks to help with autsaving after buying items. Some futureproofing for AutoSave function with parameters for skipping autosave, for when transition end is migrated to AutoSave function (whether through direct call or through a hook).
Should be ready for merging pending another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just some small comments. I also don't see where you trigger the sale ended hooks, do we still need that?
The call to |
Oh, and as a clarification, sale Item_Gives happen earlier than OnSaleEnd in other areas of code, but still utilize autosave limitations to prevent autosaving before rupee deduction. |
…a more descriptive alternative.
Refactored all references to OnReceiveItem to OnItemReceive to mirror upcoming full hook refactor for name ordering conventions. Up-to-date with develop.
OnReceiveItem
now takes aGetItemEntry
parameter to allow access to modIndex (futureproofing for mods).All access to that hook now feeds in the appropriate parameter.
Randomizer_Item_Give
now triggersOnReceiveItem
.Shop item giving now also implements mod ID tracking to properly feed into
OnReceiveItem
after pending sales go through.Build Artifacts