fix target finding helper
This commit is contained in:
parent
5a7fa13436
commit
7b1934070c
@ -2,9 +2,11 @@ export class helpers {
|
||||
static runOnTargetOrSelectedTokens (runFunc) {
|
||||
let tokens = []
|
||||
const targets = Array.from(game.user.targets)
|
||||
if (targets.length > 0) tokens = targets
|
||||
if (canvas.tokens.controlled.length > 0) tokens = canvas.tokens.controlled
|
||||
|
||||
if (targets.length > 0) {
|
||||
tokens = targets
|
||||
} else if (canvas.tokens.controlled.length > 0) {
|
||||
tokens = canvas.tokens.controlled
|
||||
}
|
||||
if (tokens.length > 0) {
|
||||
runFunc(tokens)
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user