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

Modifying past movement costs from teleporting does not take 'canceled' movement into account #42

Open PepijnMC opened 2 years ago

PepijnMC commented 2 years ago

Describe the bug The code for modifying the cost of previous teleport movement does not check if the previous token dragging actually resulted in movement history.

To Reproduce Steps to reproduce the behavior:

  1. Move normally.
  2. Set the movement mode to teleport.
  3. Drag the token around but do not move it anywhere.
  4. Drag the token around again.

Expected behavior The movement from step 1 is not modified as it was not teleport movement.

Actual Behavior The movement from step 1 is modified during step 4 because the code wrongly assumes it corresponds to the canceled teleport movement from step 3.

PepijnMC commented 1 year ago

This has turned out to be a rather annoying bug. It's what I get for messing with the kinda internal data structure of Drag Ruler's movement history. I will take another stab at it soon but if that doesn't work out I will probably move the teleportation functionality behind an experimental toggle with a warning. That way this bug doesn't delay the next release for too long, without having to completely scrap this functionality.