Skip to content

Fix weapon set branch path allocation#1904

Open
unrealdreamz wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/weapon-set-path-allocation
Open

Fix weapon set branch path allocation#1904
unrealdreamz wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/weapon-set-path-allocation

Conversation

@unrealdreamz
Copy link
Copy Markdown
Contributor

Summary

Prevent normal passive allocation from continuing through weapon-set-only branches.

Fixes #1532

Root Cause

Passive path construction treats every allocated node as a path root without remembering which root produced a candidate path. That means a node at the end of a weapon-set branch can become the closest root for the next unallocated passive. When allocation mode is switched back to normal, AllocNode only checks that a path exists, so it can allocate a normal passive from a weapon-set-only branch.

Fix

  • Track the allocated root that produced each passive path via pathRoot.
  • Clear pathRoot whenever paths are rebuilt, alongside path/pathDist.
  • In normal allocation mode, reject paths rooted in an allocated weapon-set node or explicitly passing through one.
  • Leave weapon-set mode allocation unchanged.
  • Added a focused passive-spec regression that:
    • allocates one normal node,
    • allocates the next node in weapon set 1,
    • proves normal mode cannot continue beyond that branch,
    • proves weapon set 1 still can.

Validation

Local validation run:

git diff --check
PASS (CRLF normalization warnings only)

git diff --cached --check
PASS (CRLF normalization warnings only)

git show --check --stat --oneline HEAD
PASS (CRLF normalization warnings only)

I did not run Docker/Busted locally because the available full test runner is container-based and I was avoiding external test containers/windows during this session.

Risk / Rollback

Risk is localized to passive allocation/path bookkeeping. The guard applies only while normal allocation mode is selected; weapon-set mode continues to use the existing path behavior. Rollback is the single commit if an unexpected valid normal-path edge case appears.

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.

Weapon Set Passives – Invalid Allocation

1 participant