Call D-pad items by vanilla function (remove D-pad quickdraw)#2558
Open
djevangelia wants to merge 6 commits into
Open
Call D-pad items by vanilla function (remove D-pad quickdraw)#2558djevangelia wants to merge 6 commits into
djevangelia wants to merge 6 commits into
Conversation
|
this did not affect traditional methods of obtaining quickdraw, and bottle on B is still obtainable |
|
(above comment is a good thing, not an issue with the PR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Call D-pad item use function from
Player_ProcessItemButtons(vanilla function that handles using B and C buttons), to match how normal items are used. Fixes #1654.Using a new C button item such as Ocarina requires passing through many functions:
Player_UpdateUpperBody(part of many actions),Player_CanUpdateItems(first check of various conditions that prohibit item use/change),Player_UpdateItems(second check) and then check if button is pressed/held byPlayer_ProcessItemButtons. If the button is pressed, the new item starts to get changed into throughPlayer_UseItem. If the checks are bypassed or lessened by callingPlayer_UseItemin another way, there is a risk of item-related bugs such as quickdraw.The cause of bottle on B when quickdrawing is that the held item button (last pressed button) remains as B when player is holding a C button. I tried fixing it by changing the held item button when using D-pad Ocarina but this results in problems: either no catch at all (if replaced with high number), or you have to check the C buttons for empty bottle and choose that button (what if two are equipped?). Other approaches very difficult without sabotaging normal quickdraw.
I don't think there's a way around this bug other than making use requirements for D-pad Ocarina match C-button Ocarina, so making the D-pad use the player function that handles B and C use seems reasonable.
Player_ProcessItemButtonsafter no B or C buttons are pressed but before checking if one is held. So, it can interrupt aiming with ranged weapon etc.CAN_USE_OCARINAas it contains item slot Ocarina requirement which otherwise is lost, and item restrictions which are applied through a different path on a button basis (so not applied to D unless changed).z64_usebuttonto the decomp namePlayer_UseItemto make it easier to find the source code, and it's more accurate as the function is used not only for button item use (put away is UseItem with item none etc).Player_ProcessItemButtonsto signal D-pad item use is allowed, but didn't notice much difference and considering how normal buttons only dim if restricted and again that's part of different path, I removed it.Testing
Tested in Ares 1.47, Project64 3.0.1 and Mupen64plus 2.8. Tested by using Ocarina and Bunny Hood in Kokiri Forest combined with items.
Quickdrawing doesn't work: https://www.youtube.com/watch?v=VraIC5QJTzs
Ocarina seems to behave like C buttons when interrupting first person and loaded ranged weapon.