Skip to content
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

Can Buy Blue Potion without Showing Odd Mushroom #2347

Open
r0bd0g opened this issue Jan 9, 2025 · 1 comment
Open

Can Buy Blue Potion without Showing Odd Mushroom #2347

r0bd0g opened this issue Jan 9, 2025 · 1 comment
Labels
Component: ASM/C Changes some internals of the ASM/C libraries Status: Good First Issue Good for newcomers Type: Bug Something isn't working

Comments

@r0bd0g
Copy link

r0bd0g commented Jan 9, 2025

Only works if you have nothing in your trade slot.

I didn't have trade shuffle on and my starting item was randomly selected to be Pocket Egg. I'm not sure if this only occurs under specific settings combinations or not.

@fenhl fenhl added the Type: Bug Something isn't working label Jan 9, 2025
@r0bd0g
Copy link
Author

r0bd0g commented Jan 9, 2025

Rob has this to say:

problem seems to be in this function:

uint32_t SaveFile_TradeItemIsTraded(uint16_t itemId) {
// Adult trade shuffle without full shuffle does not set traded flags
// because of timers. Some hacks still need to know if the item was
// traded independent of story flags. Child trade quest does not have
// this limitation because duping by re-trading isn't possible there.
uint16_t tradeItemNum = GetTradeItemIndex(itemId);
uint32_t traded = (z64_file.scene_flags[0x62].unk_00_ & (0x1 << tradeItemNum)) != 0;
if (itemId >= Z64_ITEM_POCKET_EGG && itemId <= Z64_ITEM_CLAIM_CHECK && !CFG_ADULT_TRADE_SHUFFLE) {
return itemId < z64_file.items[Z64_SLOT_ADULT_TRADE] || traded;
}
return traded;
}

when you don't have anything in the trade slot, z64_file.items returns 0xFF as a uint8_t so the comparison actually returns true

@fenhl fenhl added Component: ASM/C Changes some internals of the ASM/C libraries Status: Good First Issue Good for newcomers labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ASM/C Changes some internals of the ASM/C libraries Status: Good First Issue Good for newcomers Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants