stwlam / adequate-vision

A serviceable darkvision mode for Foundry VTT's dnd5e system
MIT License
2 stars 4 forks source link

[Bug] Link Actor Senses does not work with additional game masters #34

Closed FurtherV closed 1 year ago

FurtherV commented 1 year ago

Tested on a fresh foundry install with only dnd5e and adequate vision.

When you have multiple users with the game master role / permission, only the first game master (or the one which created the tokens / actors) has the linked actors senses. For any other game master the actor senses are not linked at all.

On line 156 in the script.js file you have this check: const userIsObserver = actor.getUserLevel(game.user) >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER; The problem is that actor.getUserLevel(game.user returns 0 for additional game masters and assistant game masters. Maybe this is a core bug?

dev7355608 commented 1 year ago

This behavior of getUserLevel is definitely weird. I'll investigate whether that is intended. testUserPermission works as expected for additional GMs if the optional parameter exact is false (if true, it doesn't, but that doesn't matter in AV use case).

FurtherV commented 1 year ago

Yep, was talking in the foundry discord about it. See this message and surrounding: https://discord.com/channels/170995199584108546/722566083499786352/1080511430010347572