-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25d8067
commit b82e72b
Showing
5 changed files
with
65 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"compatibility": { | ||
"minimum": "12", | ||
"verified": "13" | ||
|
@@ -43,8 +43,8 @@ | |
], | ||
"url": "https://github.com/dev7355608/limits", | ||
"manifest": "https://github.com/dev7355608/limits/releases/latest/download/module.json", | ||
"download": "https://github.com/dev7355608/limits/releases/download/v2.0.3/module.zip", | ||
"changelog": "https://github.com/dev7355608/limits/releases/tag/v2.0.3", | ||
"download": "https://github.com/dev7355608/limits/releases/download/v2.0.4/module.zip", | ||
"changelog": "https://github.com/dev7355608/limits/releases/tag/v2.0.4", | ||
"bugs": "https://github.com/dev7355608/limits/issues", | ||
"readme": "https://raw.githubusercontent.com/dev7355608/limits/main/README.md", | ||
"license": "https://raw.githubusercontent.com/dev7355608/limits/main/LICENSE" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * as geometry from "./geometry/_module.mjs"; | ||
export * as perception from "./perception/_module.mjs"; | ||
export * as sources from "./sources/_module.mjs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DetectionModeMixin } from "./detection-mode.mjs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @param {typeof foundry.canvas.perception.DetectionMode} DetectionMode | ||
* @returns {typeof foundry.canvas.perception.DetectionMode} | ||
*/ | ||
export const DetectionModeMixin = (DetectionMode) => class extends DetectionMode { | ||
/** @override */ | ||
_testPoint(visionSource, mode, target, test) { | ||
if (!super._testPoint(visionSource, mode, target, test)) { | ||
return false; | ||
} | ||
|
||
let point; | ||
|
||
if (game.release.generation >= 13) { | ||
point = test.point; | ||
} else { | ||
const { x, y } = test.point; | ||
|
||
point = TEMP_POINT; | ||
point.x = x; | ||
point.y = y; | ||
point.elevation = test.elevation; | ||
} | ||
|
||
return visionSource._testLimit(mode, point); | ||
} | ||
}; | ||
|
||
export default DetectionModeMixin; | ||
|
||
/** @type {foundry.types.ElevatedPoint} */ | ||
const TEMP_POINT = { x: 0.0, y: 0.0, elevation: 0.0 }; |