PepijnMC / ElevationDragRuler

A Foundry VTT module which adds a speedprovider for Drag Ruler to pick between different movement options based on elevation and terrain from Enhanced Terrain Layer.
MIT License
6 stars 4 forks source link

forceFlying has unintuitive priority over forceSwimming #49

Closed PepijnMC closed 1 year ago

PepijnMC commented 1 year ago

Describe the bug A token with both a flying speed and a swimming speed will automatically switch to flying movement at elevation 0 even when in water terrain.

To Reproduce Steps to reproduce the behavior:

  1. Create a token with a flying speed of 60 and a swimming speed of 90
  2. Place down water terrain
  3. Place the token in the terrain
  4. Drag the token around and notice how it uses its flying speed instead of swimming speed

Expected behavior The token has a swimming and flying speed so both forceFlying and forceSwimming can apply. Since the token being in water terrain is an explicit requirement for forceSwimming, it should take priority over the less explicit forceFlying.

Notes There is of course no solution that would automate everything exactly like the user wants, the module can't read intentions. Sometimes you might want the token to swim when in water and sometimes you might want to have it immediatelly fly out of it. The automatic movement mode merely attempts to cover the most common cases in an intuitive way, any edge cases can be 'fixed' by the user by simply switching to their desired movement speed manually.