fix: Reset traits state on chapter change - #1571
Merged
Merged
Conversation
Co-authored-by: EttyKitty <EttyKitty@users.noreply.github.com>
Collaborator
|
/review |
lyra-the-bot
approved these changes
Sep 22, 2026
lyra-the-bot
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Central reset_chapter_traits() correctly clears the two pieces of stale state that caused #1567 (activated flags + chapter_trait_meta, which drives disable()). Both call sites reset before points are recomputed/re-assigned, so no double-counting, and the existing _adv.add() loop re-populates meta/points for the new chapter. Verified scr_initialize_custom and role-ban logic consume only activated, so the reset fully covers downstream state.
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.
Implemented Option 1 (central
reset_chapter_traits()helper).Changes:
scripts/scr_ChapterTraits/scr_ChapterTraits.gml: addedreset_chapter_traits()next tosetup_chapter_traits()- clearsobj_creation.chapter_trait_metaand sets allactivated = falseonall_advantages/all_disadvantages.scripts/scr_chapter_new/scr_chapter_new.gml: callreset_chapter_traits()at top ofscr_chapter_new()before points recompute, keeping existing_adv.add()loop for the new chapter.scripts/scr_chapter_random/scr_chapter_random.gml: callreset_chapter_traits()alongsidepoints = 0reset so blank/random custom starts clean.This keeps points accounting single-owner (recomputed, not incrementally adjusted) and prevents stale meta from disabling traits on later screens.
Suggested commit (repo pattern
fix: ...):fix: reset chapter traits on chapter selectCloses #1567
github run
Summary by cubic
Fixes stale chapter traits carrying over between selections so picking a new chapter no longer leaves old traits activated or disables traits on later screens.
reset_chapter_traits()to clearchapter_trait_metaand set all advantages and disadvantages toactivated = false.Written for commit b210bee. Summary will update on new commits.