Add support for the Enhanced Terrain Layer module (resolves #50)

This commit is contained in:
Manuel Vögele
2021-04-10 14:55:47 +02:00
parent 9ae9dae427
commit 65912df989
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -2,6 +2,9 @@
### New features ### New features
- In combat Drag Ruler will now remember the path that was taken by a token during the turn. Picking the token up during the same turn will continue the previous measurement, taking steps that are already taken into account. - In combat Drag Ruler will now remember the path that was taken by a token during the turn. Picking the token up during the same turn will continue the previous measurement, taking steps that are already taken into account.
### Module compatibility
- Drag Ruler is now fully compatible with the `Enhanced Terrain Layer` module. ([#50](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/50))
## 1.4.5 ## 1.4.5
### Bugfixes ### Bugfixes
+1 -1
View File
@@ -67,7 +67,7 @@ export class SpeedProvider {
*/ */
getCostForStep(token, area) { getCostForStep(token, area) {
// Lookup the cost for each square occupied by the token // Lookup the cost for each square occupied by the token
const costs = area.map(space => canvas.terrain.costGrid[space.y]?.[space.x]?.multiple ?? 1) const costs = area.map(space => terrainRuler.getCost(space.x, space.y, {token}));
// Return the maximum of the costs // Return the maximum of the costs
return costs.reduce((max, current) => Math.max(max, current)) return costs.reduce((max, current) => Math.max(max, current))
} }