diff --git a/module/actor.js b/module/actor.js index 5dea3ff1..edec4f7f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3010,6 +3010,7 @@ export class RdDActor extends Actor { pointsReve: this.getReveActuel(), isRapide: isRapide } + let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrFormData); this.currentTMR = await RdDTMRDialog.create(html, this, tmrFormData); this.currentTMR.render(true); @@ -3923,6 +3924,7 @@ export class RdDActor extends Actor { if (status) { await this.addStatusEffect(demiReve) } else { + console.log("Delete from here ...."); await this.deleteStatusEffect(demiReve) } } @@ -3951,7 +3953,7 @@ export class RdDActor extends Actor { const ids = Array.from(this.effects?.values()) .filter(it => it.data.flags.core?.statusId == id) .map(it => it.id); - //console.log("Delete effect IDS1: ", this.effects, ids); + console.log("Delete effect IDS1: ", this.effects, ids); if (ids.length > 0) { await this.deleteEmbeddedDocuments('ActiveEffect', ids); } @@ -3962,7 +3964,7 @@ export class RdDActor extends Actor { const ids = Array.from(this.effects?.values()) .filter(it => StatusEffects.statusId(it.data) == StatusEffects.statusId(effect)) .map(it => it.id); - //console.log("Delete effect 1: ", this.effects, ids); + console.log("Delete effect 1: ", this.effects, ids); if (ids.length > 0) { await this.deleteEmbeddedDocuments('ActiveEffect', ids); } diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index bf853141..d659c4a9 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -270,12 +270,14 @@ export class RdDTMRDialog extends Dialog { /* -------------------------------------------- */ close() { - this.actor.tmrApp = undefined; // Cleanup reference - if ( !this.viewOnly ) { - this.actor.setStatusDemiReve(); - this._tellToGM(this.actor.name + " a quitté les terres médianes"); + if ( this.actor.tmrApp ) { + this.actor.tmrApp = undefined; // Cleanup reference + if ( !this.viewOnly ) { + this.actor.setStatusDemiReve(false); + this._tellToGM(this.actor.name + " a quitté les terres médianes"); + } + this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue } - this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue } /* -------------------------------------------- */ diff --git a/system.json b/system.json index f233cb60..2242a3ee 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.4.11", + "version": "1.4.12", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "0.8.5",