From 5e350030427fb58d2f9975a12bca5fcc8bf885cc Mon Sep 17 00:00:00 2001 From: IronMonk88 Date: Sun, 28 Mar 2021 15:59:17 -0700 Subject: [PATCH] 1.0.15 changes --- CHANGELOG.md | 5 +++++ classes/terrain.js | 4 ++-- classes/terrainlayer.js | 4 ++-- module.json | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b88585..36ed251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +#Version 1.0.15 +Fixed and issue with elevation + +Fixed an issue with terrainAt + #Version 1.0.14 update the code so that tokens don't think of themselves as difficult terrain. This will require the ruler to pass in the token that is moving. diff --git a/classes/terrain.js b/classes/terrain.js index fa376db..6809fd5 100644 --- a/classes/terrain.js +++ b/classes/terrain.js @@ -71,8 +71,8 @@ export class Terrain extends PlaceableObject { return this.data.multiple || Terrain.defaults.multiple; } - get type() { - return this.data.type || Terrain.defaults.type; + get terraintype() { + return this.data.terraintype || Terrain.defaults.terraintype; } static async create(data, options) { diff --git a/classes/terrainlayer.js b/classes/terrainlayer.js index bed2593..876d755 100644 --- a/classes/terrainlayer.js +++ b/classes/terrainlayer.js @@ -96,7 +96,7 @@ export class TerrainLayer extends PlaceablesLayer { const testY = (gy + hy) - terrain.data.y; if (terrain.multiple != 1 && !options.ignore?.includes(terrain.environment) && - !((terrain.terraintype == 'ground' && elevation > 0) || (terrain.terraintype == 'air' && elevation <= 0)) && + !((terrain.data.terraintype == 'ground' && elevation > 0) || (terrain.data.terraintype == 'air' && elevation <= 0)) && terrain.shape.contains(testX, testY)) { cost = Math.max(terrain.cost(options), cost); } @@ -143,7 +143,7 @@ export class TerrainLayer extends PlaceablesLayer { let terrains = this.placeables.filter(t => { const testX = (gx + hx) - t.data.x; const testY = (gy + hy) - t.data.y; - return terrain.shape.contains(testX, testY); + return t.shape.contains(testX, testY); }); return terrains; diff --git a/module.json b/module.json index 92d5ae1..ef03ea9 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "name": "enhanced-terrain-layer", "title": "Enhanced Terrain Layer", "description": "A base module that adds a Terrain Layer to Foundry. Used as a library for Rulers and other modules", - "version": "1.0.14", + "version": "1.0.15", "author": "IronMonk, ironmonk88#4075", "socket": true, "languages": [ @@ -30,7 +30,7 @@ "styles": [ "css/terrainlayer.css" ], "packs": [], "url" : "https://github.com/ironmonk88/enhanced-terrain-layer", - "download" : "https://github.com/ironmonk88/enhanced-terrain-layer/archive/1.0.14.zip", + "download" : "https://github.com/ironmonk88/enhanced-terrain-layer/archive/1.0.15.zip", "manifest" : "https://github.com/ironmonk88/enhanced-terrain-layer/releases/latest/download/module.json", "bugs": "https://github.com/ironmonk88/enhanced-terrain-layer/issues", "allowBugReporter": true,