[Bug]: @this when defining UDF does not resolve correctly
Closed this issue · 0 comments
kwvanderlinde commented
Describe the Bug
Using defineFunction() with @this on a Lib:token results in the function definition missing the Lib: prefix.
To Reproduce
- Start a new campaign.
- Add a token named
Lib:Dragon. - Add an
onCampaignLoadmacro with this line:[h: defineFunction("example", "example@this")] - Save and reload the campaign.
- Attempt to call the function:
[r: example()]. - See this error:
Must specify a location for the macro "example@Dragon" to be run from. Error trace : example@Dragon <<< chat - List the defined functions (
[r: getDefinedFunctions("json", true)]) and find the"example"entry. Notice the location is"example@Dragon"instead of"example@Lib:Dragon".
Expected Behaviour
@this should result in the full name of the Lib:token being used in the function definition.
Screenshots
No response
MapTool Info
1.18.1
Desktop
Linux Mint 22.1
Additional Context
No response