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

Fix Book requirements not updating from Objects #6316

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

kphoenix137
Copy link
Collaborator

Fixes: #6315

Applies the same fix as #6312 but for Shrines and the Chamber of Bone Tome.

@kphoenix137
Copy link
Collaborator Author

kphoenix137 commented Jul 6, 2023

Mistakenly omitted changing spell level using a variable instead of incrementing/decrementing directly and forgot the cache update. Will fix

@AJenbo AJenbo merged commit 5ebedaf into diasurgical:master Jul 6, 2023
18 checks passed
@kphoenix137 kphoenix137 deleted the fix-book-mag-req branch July 7, 2023 04:00
@@ -2548,15 +2548,17 @@ void OperateShrineEnchanted(Player &player)
spell = 1;
for (uint8_t j = static_cast<uint8_t>(SpellID::Firebolt); j < maxSpells; j++) {
if ((player._pMemSpells & spell) != 0 && player._pSplLvl[j] < MaxSpellLevel && j != spellToReduce) {
player._pSplLvl[j]++;
NetSendCmdParam2(true, CMD_CHANGE_SPELL_LEVEL, j, static_cast<uint8_t>(player._pSplLvl[j] + 1));
uint8_t newSpellLevel = static_cast<uint8_t>(player._pSplLvl[j] + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you static_cast<uint8_t> if there's no casting in the function above (with guardian)? it's inconsistent :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the previous static_cast intact. wasn't really sure why it's there to begin with but just wanted to make as little changes as possible to fix the issue with magic requirements. I'm going to open another PR since this PR isn't complete (forgot to refresh item cache). I will make that change in that PR.

@kphoenix137 kphoenix137 restored the fix-book-mag-req branch July 7, 2023 23:48
@kphoenix137 kphoenix137 deleted the fix-book-mag-req branch July 7, 2023 23:48
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.

Book Magic requirement doesn't update after using Objects
3 participants