-
Notifications
You must be signed in to change notification settings - Fork 260
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
'getSightType()' fails on newly created tokens. #1828
Comments
Might be related to #1811 . Same kind of situation. |
I don't understand how MapTool determines which sight type should be the default. Ideally it should be a Campaign property. |
I'm guessing that when the Edit Token dialog populates the 'Sight Type' list, it grabs the first one and sets it. However, a campaign is still valid with no defined sight types, and |
This is the important part. It should not produce an error especially one that implies that the macro script is in some way wrong. Adding the ability to set a default Sight type would be a separate issue. |
I think I understand what happens in this code path and like to have a go at a solution. |
This commit Closes RPTools#1828 with the simple solutions just to return an empty string when the value of getSightType() on the token is null.
This commit Closes RPTools#1828 with the simple solutions just to return an empty string when the value of getSightType() on the token is null.
Tested. Running |
Updated the wiki: |
Describe the bug
getSightType()
fails on newly created tokens.To Reproduce
Steps to reproduce the behavior:
Impersonate
.[getSightType()]
. Macro won't run, See error:Normal
.Expected behavior
getSightType()
should work on new tokens without opening the token editors.Screenshots
MapTool Info
Desktop (please complete the following information):
Additional Context
This happens whether or not the new token dialog is displayed when a new token is created.
For some reason, some trusted macros which affect the tokens will fix the issue when run by GM, but not when called by the player. It might be because the macros I tried this with were called from the GM panel, which has trust issues (#1817)
The text was updated successfully, but these errors were encountered: