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,