Add support for the Enhanced Terrain Layer module (resolves #50)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user