Skip to content

Commit

Permalink
If a token has no actor, use the user's color for highlighting grid s…
Browse files Browse the repository at this point in the history
…paces (fixes #58)
  • Loading branch information
manuelVo committed Apr 19, 2021
1 parent 4b68b82 commit 667259d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## In development
### Bugfixes
- Drag Ruler no longer prevents tokens that don't have an actor from being moved. ([#58](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/58))
- Grid highlighting now also works for tokens that don't have an actor.


## 1.5.1
### Bugfixes
- The hint that tells users how to enable difficult terrain measurement in Drag Ruler is no longer shown if no terrain layer module is installed.
Expand Down
3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 667259d

Please sign in to comment.