From bf7b61abf1422c6c22f652eba023a83356b49650 Mon Sep 17 00:00:00 2001 From: velara <74130268+velara@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:52:41 -0600 Subject: [PATCH] Update terrainlayer.js --- classes/terrainlayer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/terrainlayer.js b/classes/terrainlayer.js index 876d755..bf90167 100644 --- a/classes/terrainlayer.js +++ b/classes/terrainlayer.js @@ -99,6 +99,7 @@ export class TerrainLayer extends PlaceablesLayer { !((terrain.data.terraintype == 'ground' && elevation > 0) || (terrain.data.terraintype == 'air' && elevation <= 0)) && terrain.shape.contains(testX, testY)) { cost = Math.max(terrain.cost(options), cost); + if (cost > 1 && options.reduce?.includes(terrain.environment)) {cost -= 1}; } } @@ -114,6 +115,7 @@ export class TerrainLayer extends PlaceablesLayer { !((measType == 'ground' && elevation > 0) || (measType == 'air' && elevation <= 0)) && measure.shape.contains(testX, testY)) { cost = Math.max(measMult, cost); + if (cost > 1 && options.reduce?.includes(measEnv)) {cost -= 1}; } } @@ -606,4 +608,4 @@ export class TerrainLayer extends PlaceablesLayer { object.destroy({ children: true }); canvas.scene.data.terrain.findSplice(t => { return t._id == id; }); } -} \ No newline at end of file +}