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';