Fix erreurs dans console sur fenêtre TMR

ajout de mécanismes de sécurité pour éviter erreur rare (liée
à un état étrange après avoir été dans les TMR)
This commit is contained in:
2025-12-13 00:06:09 +01:00
parent 7ea1f36852
commit 8077656ea1

View File

@@ -13,7 +13,6 @@ import { Draconique } from "./tmr/draconique.js";
import { HtmlUtility } from "./html-utility.js";
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
import { RdDDice } from "./rdd-dice.js";
import { STATUSES } from "./settings/status-effects.js";
import { RdDRencontre } from "./item/rencontre.js";
import { ITEM_TYPES } from "./constants.js";
import { Misc } from "./misc.js";
@@ -187,7 +186,9 @@ export class RdDTMRDialog extends Dialog {
async restoreTMRAfterAction() {
this.subdialog = undefined
await this.maximize()
this.bringToFront()
if (this.rendered) {
this.bringToFront()
}
}
forceTMRContinueAction() {
@@ -348,10 +349,10 @@ export class RdDTMRDialog extends Dialog {
return false
}
this.descenteTMR = true
await await this.actor.quitterTMR(message, this.viewOnly, this.cumulFatigue)
this.pixiTMR.close();
await await this.actor?.quitterTMR(message, this.viewOnly, this.cumulFatigue)
this.pixiTMR?.close()
this.pixiTMR = undefined
await super.close();
await super.close()
return true
}