Skip to content

Name the weapon set that has points available - #2418

Open
lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/weapon-set-points-warning
Open

Name the weapon set that has points available#2418
lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/weapon-set-points-warning

Conversation

@lucaskarsten

Copy link
Copy Markdown

Fixes #2119.

Description of the problem being solved:

EstimatePlayerProgress builds the unspent weapon set points warning with the set number written into the format string (Modules/Build.lua:1051):

if not warningsWeaponSet and weaponSet1Used ~= weaponSet2Used then
    InsertIfNew(self.controls.warnings.lines, string.format(
        "You have %d Weapon set 2 passives available",
        math.abs(weaponSet2Used - weaponSet1Used)
    ))
end

The count is fine, since it is the difference between the two sets, but the set is always reported as 2. A character with fewer points allocated in set 1 is told the spare points belong to set 2.

The set with fewer allocated points is the one with room, because a node allocated in both sets is only paid for once — the same reasoning behind normalPassives = PointsUsed - m_min(weaponSet1Used, weaponSet2Used) a few lines above.

Steps taken to verify a working solution:

  • Added spec/System/TestWeaponSetPoints_spec.lua covering set 1 behind, set 2 behind, and both equal (no warning). Against dev it reports 2 successes / 1 failure; with the fix, 3 successes / 0 failures.
  • Full busted suite: 569 successes / 0 failures / 0 errors.

The warning for unspent weapon set points was formatted with "Weapon set
2" hardcoded, so a character with fewer points allocated in set 1 was
told the spare points belonged to set 2.

The count was already correct, as it is the difference between the two
sets: a node allocated in both sets is only paid for once, which is why
the smaller set is the one with room to grow, and the same reason
EstimatePlayerProgress subtracts the minimum of the two from the normal
passive count.
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.

Warning for unused weapon set points always indicates weapon set 2

1 participant