Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to Unclaim Hex #332

Closed
dylanpiera opened this issue Sep 27, 2023 · 1 comment
Closed

[Bug]: Unable to Unclaim Hex #332

dylanpiera opened this issue Sep 27, 2023 · 1 comment
Labels
bug Functionality which is not working as intended pf2e-kingmaker Issues for Pathfinder Kingmaker

Comments

@dylanpiera
Copy link

What happened?

Trying to Unclaim any hex by simply unmarking the checkbox and hitting save is not reflected.

Tried:

  • Ctrl+F5
  • Using on Chrome
  • Using on Edge

Was also reported by other users in the PF2e Foundry discord

image1
image2
image3

Issue is due to _updateObject's "Prune false-y flags", removing those keys when false and thus not updating.

/** @override */
  async _updateObject(event, formData) {
    formData = foundry.utils.expandObject(formData);
    formData.features = formData.features ? Object.values(formData.features) : [];
    const state = KingmakerHexData.cleanData(formData, {partial: true});
    for ( const [k, v] of Object.entries(state) ) {
      if ( !v ) delete state[k];  // Prune false-y flags
    }
    kingmaker.state.updateSource({
      hexes: {
        [this.object.key]: state
      }
    });
    await kingmaker.state.save();
  }

What package are you reporting this for?

Pathfinder: Kingmaker

Version

1.0

Relevant log output

No response

@dylanpiera dylanpiera added the bug Functionality which is not working as intended label Sep 27, 2023
@github-actions github-actions bot added the pf2e-kingmaker Issues for Pathfinder Kingmaker label Sep 27, 2023
@mattexdee
Copy link
Contributor

Thanks for the callout. I've fixed this locally and it will be included in our first patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended pf2e-kingmaker Issues for Pathfinder Kingmaker
Projects
None yet
Development

No branches or pull requests

3 participants