Repository navigation
Fix character progression extraction in PLRSAVE2_CheckPlayerFlags - #238
Merged
Lectem merged 1 commit intoSep 15, 2026
Merged
Conversation
CLIENTSAVEFLAG_CHARACTER_PROGRESSION_MASK is already shifted ((0x1F) << CLIENTSAVEFLAG_CHARACTER_PROGRESSION_BIT), so masking after the shift instead of before it looks at the wrong five bits: the expression selects bits 16-20 of the flags and then truncates to uint8_t, which drops them. nProgression is therefore 0 for every character, whatever their real progression, and the difficulty gates below always report PLRSAVE2ERROR_NIGHTMARE_NOT_UNLOCKED / PLRSAVE2ERROR_HELL_NOT_UNLOCKED. Mask first, then shift, matching sub_6FC8A780 in PlrSave.cpp, which reads the same field correctly. Verified with a standalone probe over progressions 0-15: before the change the extracted value is 0 for all of them and an expansion character is never allowed into Nightmare; after it, the value tracks the field and the gate opens at 5 (expansion) as the flag comment describes. Fixes ThePhrozenKeep#200
Mw95
approved these changes
Sep 15, 2026
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.
Fixes #200.
CLIENTSAVEFLAG_CHARACTER_PROGRESSION_MASKis already shifted (0x1F << CLIENTSAVEFLAG_CHARACTER_PROGRESSION_BIT), soPLRSAVE2_CheckPlayerFlagsmasking after the shift selects bits 16-20, and theuint8_ttruncation then drops them.nProgressionis 0 for every character, so the difficulty gates below it always returnPLRSAVE2ERROR_NIGHTMARE_NOT_UNLOCKED/PLRSAVE2ERROR_HELL_NOT_UNLOCKED.Mask first, then shift - the first form suggested in the issue, and what
sub_6FC8A780inPlrSave.cpp(line 840) already does for the same field. One line.Checked with a standalone probe over progressions 0-15: before, the extracted value is 0 for all of them; after, it tracks the field and the Nightmare gate opens at 5 for an expansion character.