Only show range colors to players who have observer permissions for that token

This commit is contained in:
Manuel Vögele
2021-02-02 11:44:20 +01:00
parent c8a7352d5f
commit 33cb9a2ba2
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
## In development
### New features
- The drag ruler will now be colored for other players than the dragging player as well
- The drag ruler will now be colored for other players than the dragging player as well (only if they have at least observer permissions for that token)
- The drag ruler won't be shown to other players if they cannot see the dragged token
## v1.0.1
+4
View File
@@ -172,6 +172,10 @@ function nativeSpeedProvider(token, playercolor) {
function getColorForDistance(startDistance, subDistance) {
if (!this.isDragRuler)
return this.color
// Don't apply colors if the current user doesn't have at least observer permissions
if (this.draggedToken.actor.permission < 2) {
return this.color
}
const distance = startDistance + subDistance
const ranges = currentSpeedProvider(this.draggedToken, this.color)
if (ranges.length === 0)