Skip to content

[Bug]: 1.18 - getMacroLocation() on Lib:tokens not consistent #5638

@kwvanderlinde

Description

@kwvanderlinde

Describe the Bug

When clicking a macro button on a Lib:token, getMacroLocation() returns only the part of the token name after the Lib:. When invoking the macro via [macro("someMacro@Lib:token"): ""], getMacroLocation() returns the full token name.

On 1.17, getMacroLocation() always returned the full token name.

To Reproduce

  1. Add a token to the map and name it Lib:Dragon.
  2. Add a Testing macro to Lib:Dragon with these contents:
    [h: broadcast(getMacroLocation())]
    
  3. Add a Test2 macro to Lib:Dragon with these contents:
    [h: broadcast(getMacroLocation())]
    [macro("Testing@TOKEN"): ""]
    [macro("Testing@this"): ""]
    
  4. Click Testing and observe the following printed to chat:
    Dragon
    
  5. Click Test2 and observe the following printed to chat:
    Dragon
    Lib:Dragon
    Dragon
    

Expected Behaviour

getMacroLocation() should return the full token name when the location is a Lib:token.

In particular, the behaviour of the given macros should match 1.17. I.e., clicking on Testing should result in:

Lib:Dragon

And clicking on Test2 should result in:

Lib:Dragon
Lib:Dragon
Lib:Dragon

Screenshots

No response

MapTool Info

1.18.0-rc.1

Desktop

Linux Mint 22.1

Additional Context

@token has a similar issue with getMacroLocation(), and so does @this.

Locations like @gm also differ from 1.17, but only in case.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Merged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions