Skip to content

Preserve explicit zero values in configuration fields - #10354

Open
AdamZ-8113 wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
AdamZ-8113:fix/config-zero-persistence
Open

AdamZ-8113 wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
AdamZ-8113:fix/config-zero-persistence

Conversation

@AdamZ-8113

@AdamZ-8113 AdamZ-8113 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #10143

Description of the problem being solved:

Setting a numeric config field to 0 can reopen as blank after saving. For some overrides, blank means maximum, so the distinction matters.

This happens because saving treats zero or the field's placeholder as its default. This preserves entered numeric values that wouldn't be restored by the field's declared default, while keeping untouched defaults and default dropdown selections omitted. Charges for both players and minions also now accept zero during calculations.

Steps taken to verify a working solution:

  • Verified zero, positive and blank inputs through full build XML save/load across three config sets.
  • Verified player and minion charge counts after reload, including blank restoring maximum charges.
  • Confirmed untouched numeric defaults and default dropdown selections remain omitted, while existing non-default settings survive reload.
  • Compared saved builds: The PR'd build sets Endurance Charges to 0 and was only 62 bytes larger, with no unrelated config entries added.
  • Targeted suite: 4 passed. Full configured Docker suite: 588 passed, no failures or errors (#builds excluded).
  • git diff --check passed. Native UI reload verification wasn't performed.

Link to a build that showcases this PR:

https://pob.codes/b/vJ_H7EO1L4x - will need to manually set the configs probably, then save and reload the build.

Before screenshot:

image

After screenshot:

  • Time spent station and endurance charges set to 0
image

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.

Config number fields "(if not maximum)" revert from 0 to blank (max) after closing build

1 participant