If a token has no actor, use the user's color for highlighting grid spaces (fixes #58)

This commit is contained in:
Manuel Vögele
2021-04-19 11:22:13 +02:00
parent 4b68b82590
commit 667259d5d6
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -166,6 +166,9 @@ function onTokenDragLeftCancel(event) {
export function getColorForDistance(startDistance, subDistance=0) {
if (!this.isDragRuler)
return this.color
if (!this.draggedToken.actor) {
return this.color;
}
// Don't apply colors if the current user doesn't have at least observer permissions
if (this.draggedToken.actor.permission < 2) {
// If this is a pc and alwaysShowSpeedForPCs is enabled we show the color anyway