Fix incorrect logic in ACT1Q2_Callback03_ChangedLevel#228
Open
devtejasx wants to merge 1 commit into
Open
Conversation
The second fState < 3 check could never trigger because the first check calls QUESTS_StateDebug, which sets fState to 3. Vanilla keeps the result of the first comparison in a stack boolean (verified against the 1.13c assembly at D2Game.0x64EE9 per issue ThePhrozenKeep#227), so do the same here. Fixes ThePhrozenKeep#227
devtejasx
force-pushed
the
fix/a1q2-changedlevel-227
branch
from
July 8, 2026 20:07
58279e6 to
e3e6075
Compare
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.
Summary
Fixes #227.
In
ACT1Q2_Callback03_ChangedLevel, the secondpQuestData->fState < 3check could never trigger: the first check callsQUESTS_StateDebug(pQuestData, 3, ...), which assignsfState = 3, so by the time the second check runs the condition is always false.As noted in the issue, vanilla handles this with a boolean stored on the stack that is set by the first check on
pQuestData->fState(verified against the 1.13c assembly atD2Game.0x64EE9). This PR restores that behavior by capturing the comparison in a localconst bool bStateUpdatedbeforeQUESTS_StateDebugmutatesfState, and using it for both branches.Changes
source/D2Game/src/QUESTS/ACT1/A1Q2.cpp: hoist thefState < 3comparison into a stack boolean and reuse it in the second branch, matching vanilla behavior.🤖 Generated with Claude Code