Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jan 29, 2023
2 parents c9a8c4b + 0c3242d commit 13e5de0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Give a vertical dimension to your walls.

![Latest Release Download Count](https://img.shields.io/github/downloads/theripper93/wall-height/latest/module.zip?color=2b82fc&label=DOWNLOADS&style=for-the-badge) [![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fwall-height&colorB=03ff1c&style=for-the-badge)](https://forge-vtt.com/bazaar#package=wall-height) ![Foundry Core Compatible Version](https://img.shields.io/badge/dynamic/json.svg?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftheripper93%2Fwall-height%2Fmain%2Fmodule.json&label=Foundry%20Version&query=$.compatibleCoreVersion&colorB=orange&style=for-the-badge) [![alt-text](https://img.shields.io/badge/-Website-%23ffcb77?style=for-the-badge)](https://theripper93.com/) [![alt-text](https://img.shields.io/badge/-Patreon-%23ff424d?style=for-the-badge)](https://www.patreon.com/theripper93) [![alt-text](https://img.shields.io/badge/-Discord-%235662f6?style=for-the-badge)](https://discord.gg/F53gBjR97G)

## The documentation has moved to the [WIKI](https://theripper93.com/wiki/index.php/Wall_Height)
## You can find the documentation on the [WIKI](https://api.theripper93.com/modulewiki/wall-height/free)

## License

Expand Down
16 changes: 14 additions & 2 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,21 @@ export function registerWrappers() {
MODULE_ID,
"VisionSource.prototype.elevation",
function () {
return this.object.losHeight;
return this.object?.losHeight ?? canvas.primary.background.elevation;
},
libWrapper.OVERRIDE,
{ perf_mode: libWrapper.PERF_FAST }
);
);

libWrapper.register(
MODULE_ID,
"LightSource.prototype.elevation",
function () {
return this.object instanceof Token
? this.object.losHeight
: this.object?.document?.elevation ?? canvas.primary.background.elevation;
},
libWrapper.OVERRIDE,
{ perf_mode: libWrapper.PERF_FAST }
);
}

0 comments on commit 13e5de0

Please sign in to comment.