From c4392f0320827ada35211116e8be6a0964925b73 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 17 Sep 2022 23:44:51 +0200 Subject: [PATCH] Fix TMR accessibles par une rencontre MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les cases n'étaient polus accessibles, ni coloriées --- module/rdd-tmr-dialog.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index 8bd2ce34..1546dd94 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -322,8 +322,8 @@ export class RdDTMRDialog extends Dialog { this.currentRencontre.graphics = []; // Keep track of rectangles to delete it this.currentRencontre.locList = duplicate(listCoordTMR); // And track of allowed location for (let coordTMR of listCoordTMR) { - let rect = this._getCaseRectangleCoord(coordTMR); - var rectDraw = new PIXI.Graphics(); + const rect = this._getCaseRectangleCoord(coordTMR); + const rectDraw = new PIXI.Graphics(); rectDraw.beginFill(0xffff00, 0.3); // set the line style to have a width of 5 and set the color to red rectDraw.lineStyle(5, 0xff0000); @@ -342,18 +342,13 @@ export class RdDTMRDialog extends Dialog { /* -------------------------------------------- */ async choisirCasePortee(coord, portee) { - if (this.actor.isTMRCache()) { - return; - } // Récupère la liste des cases à portées - let locList = TMRUtility.getTMRPortee(coord, portee); - this.colorierZoneRencontre(locList); + this.colorierZoneRencontre(TMRUtility.getTMRPortee(coord, portee)); } /* -------------------------------------------- */ async choisirCaseType(type) { - const locList = TMRUtility.filterTMR(it => it.type == type).map(it => it.coord); - this.colorierZoneRencontre(locList); + this.colorierZoneRencontre(TMRUtility.filterTMR(it => it.type == type).map(it => it.coord)); } /* -------------------------------------------- */ @@ -932,7 +927,7 @@ export class RdDTMRDialog extends Dialog { const isInArea = this.rencontreState == 'aucune' ? (this.isTerreAttache(targetCoord) || this.isConnaissanceFleuve(currentCoord, targetCoord) || TMRUtility.distanceOddq(fromOddq, toOddq) <= 1) - : this.currentRencontre?.locList.find(coord => coord == targetCoord) ?? false + : this.currentRencontre?.locList?.find(coord => coord == targetCoord) ?? false if (isInArea) { switch (this.rencontreState) { case 'aucune': return 'normal';