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]: Type error doing arithmetic with getTokenOpacity() #5066

Open
kwvanderlinde opened this issue Nov 21, 2024 · 0 comments
Open

[Bug]: Type error doing arithmetic with getTokenOpacity() #5066

kwvanderlinde opened this issue Nov 21, 2024 · 0 comments
Labels

Comments

@kwvanderlinde
Copy link
Collaborator

Describe the Bug

If multiplying the result of getTokenOpacity() without first storing it in a variable results in an exception:

Illegal argument type java.lang.Float, expecting java.math.BigDecimal
Error trace : chat

To Reproduce

  1. Get the ID of a token.
  2. Create a macro with this command:
    [r: 100 * getTokenOpacity("<token id>")]
    
  3. Run the macro. Will report an error.
  4. Modify the macro to look like this:
    [h: vOpacity = getTokenOpacity("<token id>")]
    [r: 100 * vOpacity]
    
  5. Run the macro. No more errors.

Expected Behaviour

It should be possible to use getTokenOpacity() in line.

Screenshots

No response

MapTool Info

1.15.2

Desktop

Linux Mint 22

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant