erithtotl / wall-height

New fork of original project for continued improvements.
https://github.com/erithtotl/wall-height
GNU General Public License v3.0
6 stars 9 forks source link

Fix Current Token in v9 #40

Closed JDCalvert closed 2 years ago

JDCalvert commented 2 years ago

Added wrapper for Token.updateVisionSource for Foundry v9. This function kicks off the ClockwiseSweepPolygon creation to recalculate the token's vision. This update's Wall Height's currentTokenElevation and currentTokenHeight to the token currently being calculated, so we have the correct data to include/ignore walls.

This change retains compatablity with Foundry v8 while fixing vision issues with multiple tokens in v9 (issue #36).

Also tidied the code to make it more easily readable.