diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index ac450e98..9dc42f28 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -285,7 +285,12 @@ export class RdDTMRDialog extends Dialog { } /* -------------------------------------------- */ - async onActionRencontre(action, tmr) { + async onActionRencontre(action, tmr, rencontre) { + if (!this.currentRencontre){ + ui.notifications.warn("#612 Rencontre perdue, récupération en cours. Vous pouvez contacter l'équipe avec les logs pour aider à résoudre ce problème") + console.error("#612 Rencontre perdue", action, tmr, rencontre, this); + this.currentRencontre = rencontre; + } switch (action) { case 'derober': await this.derober(); @@ -589,6 +594,7 @@ export class RdDTMRDialog extends Dialog { return await game.system.rdd.rencontresTMR.getRencontreAleatoire(tmr, this.actor.isMauvaiseRencontre()) } else { this._tellToUser(myRoll + ": Pas de rencontre en " + locTMR); + return undefined; } } diff --git a/module/rdd-tmr-rencontre-dialog.js b/module/rdd-tmr-rencontre-dialog.js index 804dd160..b1a859f2 100644 --- a/module/rdd-tmr-rencontre-dialog.js +++ b/module/rdd-tmr-rencontre-dialog.js @@ -29,12 +29,13 @@ export class RdDTMRRencontreDialog extends Dialog { this.toClose = false; this.tmr = tmr; this.tmrApp = tmrApp; + this.rencontre = rencontre; this.tmrApp.minimize(); } async onButtonAction(action) { this.toClose = true; - this.tmrApp.onActionRencontre(action, this.tmr) + this.tmrApp.onActionRencontre(action, this.tmr, this.rencontre) } /* -------------------------------------------- */