Skip to content

Fix applyRange plus sign at zero#1888

Open
unrealdreamz wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/apply-range-signed-zero
Open

Fix applyRange plus sign at zero#1888
unrealdreamz wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/apply-range-signed-zero

Conversation

@unrealdreamz
Copy link
Copy Markdown
Contributor

Fixes #1412

Summary

  • Stop preserving a leading + when ranged item text resolves exactly to zero.
  • Add an applyRange regression for a signed range centered on zero.

Root Cause

itemLib.applyRange preserved the original plus sign when the interpolated range value was >= 0. That produced +0 ... for ranges that land exactly on zero, even though the rest of item text formatting uses plain 0.

Fix

Preserve + only for strictly positive interpolated values. Negative values already drop the plus sign, and now zero does too.

Validation

  • git diff --check - pass, exit code 0.
  • Targeted regression added in spec/System/TestItemTools_spec.lua.
  • Docker/Busted not run locally in this pass because this machine was explicitly kept free of local test/container windows; GitHub Actions should run the normal suite on the PR.

Risk/Rollback

Very low risk: the change is limited to signed range formatting when an originally plus-prefixed range resolves to exactly zero.

Copy link
Copy Markdown
Contributor

@LocalIdentity LocalIdentity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not work, currently just hides the slider now

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.

Error when changing slider value of Adonia's Ego Maximum Power Charges Mod

2 participants