manuelVo / foundryvtt-drag-ruler

A Foundry VTT module that shows a ruler when dragging tokens so you can see how far you've dragged them
MIT License
39 stars 50 forks source link

No printed measurement #280

Closed n0q closed 1 year ago

n0q commented 1 year ago

Under v11, drag ruler no longer prints the distance measured. Tested on v11.301 across multiple systems, both with and without a grid.

image

n0q commented 1 year ago

The issue resolves if the below test is circumvented so it always fails:

https://github.com/manuelVo/foundryvtt-drag-ruler/blob/844df150a6ccd0f8e5aeba342fcce00ed858d933/src/ruler.js#L265

Obviously that's not an acceptable fix.

YenBenGrey commented 1 year ago

Just tested it myself and I thought the numericals were from a different module, I was doubting myself.

However can confirm that there are no numericals. Even sneakily tried it in Crucible. It shows the distance and the actor moves along but it doesn't match up with the new Action Point rules in combat.

manuelVo commented 1 year ago

Obviously that's not an acceptable fix.

Surprisingly it is. The else-path contains everything that's necessary to handle both states: this.dragRulerEnableTerrainRuler being true and false. I have no clue how this redundant code path sneaked in there, but I suppose it probably happened during the migration to v10, where a major code refactor was necessary for compatibility.