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

User lacks permission to update Token #84

Closed MarlQ closed 10 months ago

MarlQ commented 10 months ago

Every user in my game who doesn't own the token gets an error popup "User ... lacks permission to update Token..." whenever I place a token.

I tracked it down with the debugger, and it's because it tries to set the flag "elevationMeasurement" without permission. I modified the drawTokenHook function inside Token.js so that it checks for ownership in the if check: if ( !token.document.getFlag(MODULE_ID, ALGORITHM) && token.document.isOwner) { ... } That fixed it.

Keep in mind, that I'm using my own, custom system, which might modify some other logic which might cause this.

caewok commented 10 months ago

Should be fixed in v0.5.9. Thanks for the code suggestion!