Skip to content

Commit

Permalink
Skip tokens of non-character/NPC actors
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Jun 21, 2023
1 parent 09c06d4 commit a58e1b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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.2",
"version": "1.3.3",
"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.2/module.zip",
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.3.2",
"download": "https://github.com/dev7355608/vision-5e/releases/download/v1.3.3/module.zip",
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.3.3",
"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
8 changes: 5 additions & 3 deletions scripts/automation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Hooks.once("init", () => {
prepareData() {
super.prepareData();

if (this.type !== "character" && this.type !== "npc") {
if (!(this.type === "character" || this.type === "npc")) {
return;
}

Expand All @@ -92,8 +92,10 @@ Hooks.once("init", () => {
CONFIG.Token.documentClass = class TokenDocument5e extends CONFIG.Token.documentClass {
/** @override */
_prepareDetectionModes() {
if (this.sight.enabled && this.actor) {
const inheritedModes = getInheritedDetectionModes(this.actor);
const actor = this.actor;

if (this.sight.enabled && actor && (actor.type === "character" || actor.type === "npc")) {
const inheritedModes = getInheritedDetectionModes(actor);
const basicId = CONFIG.Canvas.visionModes[this.sight.visionMode]?.detectionMode
?? DetectionMode.BASIC_MODE_ID;
const basicMode =
Expand Down

0 comments on commit a58e1b3

Please sign in to comment.