caewok / fvtt-elevated-vision

Adjust Foundry VTT vision, lighting, and token elevations based on terrain, wall, or token elevation.
MIT License
12 stars 5 forks source link

[Compatibility Issue] Incompatible with Rideables riding height #83

Closed Saibot393 closed 1 year ago

Saibot393 commented 1 year ago

One of my modules, Rideable, sets the elevation of certain mounted tokens depending on the mounted tokens elevation and height. The problem is, that should the mounted move and get a new elevation through Elevated Vision, so will its riding tokens causing them to appear bellow their mount. I looked at your code a bit and don't think i can easily fix this on my end.

From what i have seen, your module manipulates the elevation in preUpdateToken call. An easy solution on your end would be to ignore all preUpdateToken calls in which the third parameters has a property RidingMovement == true for the purpose of setting the elevation (see attached image). image

caewok commented 1 year ago

Should be fixed in v0.5.9. I did what you suggested; thanks for that!

Saibot393 commented 1 year ago

Thank you.

Saibot393 commented 1 year ago

Sorry to bother you again, i missed the elevation update on refresh in my initial testing. Could you add something like if (game.modules.get("Rideable").active && game.modules.get("Rideable").api.isRider(token.document)) return; to the refreshTokenHook function in Token.js, i think that should fix the compatibility.