Skip to content

Commit

Permalink
Initialize vision only if the token has an active vision source
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Jun 18, 2023
1 parent 23e0517 commit 728e706
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"email": "dev7355608@gmail.com"
}
],
"version": "1.3.0",
"version": "1.3.1",
"compatibility": {
"minimum": "11.299",
"verified": "11.302"
Expand Down Expand Up @@ -46,8 +46,8 @@
},
"url": "https://github.com/dev7355608/vision-5e",
"manifest": "https://github.com/dev7355608/vision-5e/releases/latest/download/module.json",
"download": "https://github.com/dev7355608/vision-5e/releases/download/v1.3.0/module.zip",
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.3.0",
"download": "https://github.com/dev7355608/vision-5e/releases/download/v1.3.1/module.zip",
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.3.1",
"bugs": "https://github.com/dev7355608/vision-5e/issues",
"readme": "https://raw.githubusercontent.com/dev7355608/vision-5e/main/README.md",
"license": "https://raw.githubusercontent.com/dev7355608/vision-5e/main/LICENSE"
Expand Down
9 changes: 7 additions & 2 deletions scripts/automation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ const resetActiveTokens = (() => {

for (const actor of actors) {
for (const token of actor.getActiveTokens(false, true)) {
if (token.sight.enabled) {
token.reset();
if (!token.sight.enabled) {
continue;
}

token.reset();

if (canvas.ready && canvas.effects.visionSources.has(token.object.sourceId)) {
initializeVision = true;
}
}
Expand Down

0 comments on commit 728e706

Please sign in to comment.