Skip to content

Add Y distance check to business Deku Scrub talk#2552

Open
djevangelia wants to merge 1 commit intoOoTRandomizer:Devfrom
djevangelia:dekyscruby
Open

Add Y distance check to business Deku Scrub talk#2552
djevangelia wants to merge 1 commit intoOoTRandomizer:Devfrom
djevangelia:dekyscruby

Conversation

@djevangelia
Copy link
Copy Markdown

ASM fix to add Y distance check to business Deku Scrub talking, which includes selling items. Fixes #2285.

Deku Scrubs have a Y distance check for giving the item, but not for selling it. In MQ Deku Tree player can buy the item from the water (is within XZ distance), but cannot receive it (is outside Y distance), potentially losing the check. This adds Y distance check of 100.0f to talking, which is the same as receiving item.

The float distance checking is 100% a product of disassembly of C code and I cannot explain how it works at all, but it does. I used matching decomp NTSC 1.0 as base, added check, took the disassembly and modified it to fit with jumps.

Testing

Works in Ares 1.47, Project64 3.0.1 and Mupen64plus 2.8. https://www.youtube.com/watch?v=qhhwmbkHhbo
Tested with adult as well.
I have not tested any scrubs beyond MQ Deku Tree and Lost Woods bridge. If the added check somehow would mess with a scrub I'll look into how that could be solved. A scene id check could be added to make this change only apply to the MQ Deku Tree scrub etc.

@flagrama
Copy link
Copy Markdown

If the code doesn't make sense in ASM but makes sense in C, I think you should create a C function for it instead. You're already successfully recompiling the C which isn't necessary for ASM only hacks, so you have already finished the hard part of getting a toolchain setup. Instead of creating a label EnDns_CheckYDist in a ASM file, create a C file or add to an appropriate existing one a function called EnDns_CheckYDist. You may need to make adjustments to the jumping code for calling convention needs to send the right arguments, or you may not, but you can get help in the dev channel on Discord if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Softlock possibility with the new feature of paying before obtaining a scrub item

2 participants