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

Remove CalcPlrStaff() #7468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kphoenix137
Copy link
Collaborator

This function is duplicate logic of the CalcPlrItemVals() logic for staves, which creates the potential for bugs.

CalcPlrInv():
CalcPlrItemVals() iterates each equipped item, and accumulates the spell from each item, then writes the bitmask to the Player struct variable that holds staff spells.

CalcPlrStaff is then called if player is myPlayer, and checks the left hand specifically with some conditions to see if it should add the spell from the staff to the Player struct variable. CalcPlrStaff() is also utilized to check if the player should continue having the staff spell after consuming a charge. This PR bypasses the need for that by directly calling CalcPlrInv() when consuming a charge, so we consistently call CalcPlrInv() any time there is an update in any form to the player's equipped items. This also keeps the logic in one place to avoid discrepancies.

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.

2 participants