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

Condition options setStates/unsetStates return wrong data in getTokens/getTokenNames #1292

Closed
Phergus opened this issue Feb 18, 2020 · 4 comments
Assignees
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.

Comments

@Phergus
Copy link
Contributor

Phergus commented Feb 18, 2020

Describe the bug
Passing a string with a single state name instead of an array does not produce an error but instead returns incorrect information. Passing a string did work in 1.5.10.

Both setStates and unsetStates conditions for getTokens()/getTokenNames() are documented to take a JSON array of the states to be checked for.

To Reproduce
Steps to reproduce the behavior:

  1. Drop multiple tokens on a map.
  2. Enable the Dead state on some tokens

With this code, and one or more tokens with the Dead state set, MT 1.5.12/13 returns an empty string.

[h: conditions = json.set("{}", "setStates", "Dead")]
[r: names = getTokenNames(",", conditions)]

With this code and one or more tokens with the Dead state not set, MT 1.5.12/13 returns all of the tokens.

[h: conditions = json.set("{}", "unsetStates", "Dead")]
[r: names = getTokenNames(",", conditions)]

Expected behavior
In version 1.5.10, the same code returns the correct list of tokens.

MapTool Info

  • Version: 1.5.12
  • Install: Any

Desktop:

  • OS: Windows
  • Version: 10
@Phergus Phergus added bug documentation needed Missing, out-of-date or bad documentation macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) labels Feb 18, 2020
Merudo added a commit to Merudo/maptool that referenced this issue Feb 18, 2020
@Merudo
Copy link
Member

Merudo commented Feb 18, 2020

PR #1295 fixes this.

Merudo added a commit to Merudo/maptool that referenced this issue Feb 18, 2020
Merudo added a commit to Merudo/maptool that referenced this issue Feb 18, 2020
- Fix similar issues for "light" and "propertyType" options
- Fix RPTools#1292
@Merudo
Copy link
Member

Merudo commented Feb 18, 2020

Also there are similar bugs with propertyType , light, and owned, which I also fixed.

Merudo added a commit to Merudo/maptool that referenced this issue Feb 18, 2020
- Fix similar issues for "light", "propertyType", and "owner" options
- Fix RPTools#1292
Merudo added a commit to Merudo/maptool that referenced this issue Feb 19, 2020
- Fix similar issues for "light", "propertyType", and "owner" options
- Fix RPTools#1292
Merudo added a commit to Merudo/maptool that referenced this issue Feb 19, 2020
- Fix similar issues for "light", "propertyType", and "owner" options
- Fix RPTools#1292
Phergus pushed a commit that referenced this issue Feb 19, 2020
- Fix similar issues for "light", "propertyType", and "owner" options
- Fix #1292
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Feb 20, 2020
@Phergus
Copy link
Contributor Author

Phergus commented Feb 20, 2020

Tested conditions setStates, unsetStates, propertyType, light, and owned. Working as expected.

@Phergus
Copy link
Contributor Author

Phergus commented Feb 20, 2020

Wiki pages for getTokens()/getTokenNames() updated.

@Phergus Phergus closed this as completed Feb 20, 2020
@Phergus Phergus removed the documentation needed Missing, out-of-date or bad documentation label Feb 20, 2020
Phergus added a commit that referenced this issue Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

2 participants