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

Bush Item Drops: Vanilla Bug #3148

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

inspectredc
Copy link
Contributor

@inspectredc inspectredc commented Aug 24, 2023

I found this a while ago when discussing why fairies would spawn from bushes but other items seemingly wouldn't. It turns out that the wrong actor parameter was being passed to the function which would call the actor spawn and so item00 actors were being spawned with undefined actor params, causing uncollectible and invisible items (due to the undefined nature) to spawn; fairies turned out to be handled as a special case before this function would get called.

May need more testing but I believe this path is only reachable from rustling the bushes, from memory the function's params need params & 0x8000 to be true. In the case of the bush the function param is 0x8020 and there is no defined item00 with actor param 0x20 (only the last part is taken into account). Regular items would be spawned with params in the range 0x8000 -> 0x8019 (0x8018 without chu drops), however, this would still be what I believe is 'unintended' behaviour.

Wasn't sure if this should be added to any enhancement presets so lmk if any are suitable.

Build Artifacts

@inspectredc
Copy link
Contributor Author

Quick note on the reason why I think this change is the appropriate fix: the function goes through the process of figuring out the dropId for an item based on a lookup from the param passed into the function. In other paths it then calls the next function for eventually calling the actor spawn. In the path that is being fixed, the dropId has been calculated but then is left unused and the param value used to generate the item dropId is instead passed along.

@Archez
Copy link
Contributor

Archez commented Aug 24, 2023

Looking into it, it seems the difference of & 0x8000 or not is whether the drop is "auto collected" when spawned. Scanning over the code paths, it looks like the only other code path is from En_WonderItem that is set to random drop and autocollect. I'm not aware of off the top of my head which wonder items those would be (it's possible there is no such combination, but was just coded because N devs 🤷).

Other than that, I think the approach to the fix looks correct based on the other ways item00 drops are spawned.

@garrettjoecox garrettjoecox merged commit 0f41b25 into HarbourMasters:develop Sep 10, 2023
8 checks passed
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.

None yet

3 participants