RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
800 stars 262 forks source link

[Bug]: Cone & Beam Auras change a token's default facing #4929

Closed Baaaaaz closed 1 month ago

Baaaaaz commented 2 months ago

Describe the Bug

A token with the default down facing (i.e. equivalent -90 degrees) has its facing incorrectly set to 0 degrees (i.e. right facing) whenever an cone aura or beam aura is applied to it. Thereafter, MapTool's clear/remove facing features (in both via GUI & MT script) no longer work as expected until the offending aura is removed from the token.

This can cause issues for game systems that need to track or manage token rotation and would like to use auras for range/targeting from these tokens.

To Reproduce

  1. Open a new blank campaign in v1.14.3 or 1.15.0 (N.B. aura beams are not available prior to 1.15.0, but the issue also manifests with aura cones in 1.14.3)

  2. Add some cone and beam auras to the campaign: e.g. Menu bar -> Edit -> Campaign Properties -> Light

    Auras
    ----
    Range Arcs 30/60/90: aura cone arc=135 30.5 30.9#000000 60.5 60.9#000000 90.5 90.9#000000
    Line of Sight: aura beam width=0.4 150#ffff00
  3. Create a brand-new token on the map. Note that the token should have MapTool's default facing i.e. no facing indicator arrow is shown (if Token Shape != TOP_DOWN), getTokenFacing() returns "", and getTokenRotation() returns 0.

  4. Apply the cone and/or beam aura to the token.

  5. Observe that token facing indicator arrow appears and points to the right (or if Token Shape = TOP_DOWN the token is rotated anti-clockwise 90 degrees), getTokenFacing() returns 0 , and getTokenRotation()returns -90

  6. Try "Clear Facing" using the token popup menu GUI. Observe that there is no change to the token's facing - it still points to the right.

  7. Manually rotate the token, and try again "Clear Facing" using the token popup menu GUI. Observe how the token facing is reset to the right rather than down, the correct MapTool default facing.

  8. Clear all auras from the token, and try again "Clear Facing" using the token popup menu. Observe how the token facing is reset to down (MapTool's default token facing), getTokenFacing() again returns "", and getTokenRotation() again returns 0.

N.B. Using the MT script function removeTokenFacing() provides identical results to manually clearing the facing using the popup menu GUI.

Expected Behaviour

A token's default facing should not be modified when applying any aura and whether an aura is active or not should not effect the behaviour of clear/remove facing features.

Screenshots

image

MapTool Info

1.14.3, 1.15.0

Desktop

No response

Additional Context

https://wiki.rptools.info/index.php/getTokenFacing https://wiki.rptools.info/index.php/getTokenRotation https://wiki.rptools.info/index.php/Aura