From 16ce6a58ddc848eb59ceb3854b23184d193bf57f Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 22 Jul 2022 00:31:27 +0200 Subject: [PATCH] Fix accorder entite de cauchemar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A priori vieille régression, pas vue depuis. attaquant._id est devenu attaquant.id --- module/actor.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/module/actor.js b/module/actor.js index 5fb2a4e2..0a31555f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -98,7 +98,6 @@ export class RdDActor extends Actor { * @param {Object} options (Unused) Additional options which customize the creation workflow. * */ - static async create(actorData, options) { // Case of compendium global import if (actorData instanceof Array) { @@ -135,13 +134,6 @@ export class RdDActor extends Actor { this.encTotal = 0; this.prixTotalEquipement = 0; - /* - // Auto-resize token - if (this.isToken) { - let tokenSize = actorData.data.carac.taille.value/10; - this.token.update({height: tokenSize, width: tokenSize } ); - }*/ - // Make separate methods for each Actor type (character, npc, etc.) to keep // things organized. if (actorData.type === 'personnage') this._prepareCharacterData(actorData); @@ -3593,7 +3585,7 @@ export class RdDActor extends Actor { isEntiteCauchemarAccordee(attaquant) { if (!this.isEntiteCauchemar()) { return true; } let resonnance = Misc.templateData(this).sante.resonnance; - return (resonnance.actors.find(it => it == attaquant._id)); + return (resonnance.actors.find(it => it == attaquant.id)); } /* -------------------------------------------- */ @@ -3603,11 +3595,11 @@ export class RdDActor extends Actor { return; } let resonnance = duplicate(Misc.templateData(this).sante.resonnance); - if (resonnance.actors.find(it => it == attaquant._id)) { + if (resonnance.actors.find(it => it == attaquant.id)) { // déjà accordé return; } - resonnance.actors.push(attaquant._id); + resonnance.actors.push(attaquant.id); await this.update({ "data.sante.resonnance": resonnance }); return; }