From f32b6af7b6c73c2dd3fd070c1eab4de69cdae5a5 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Sun, 6 Apr 2025 23:13:59 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20sur=20les=20mise=20=C3=A0=20jour?= =?UTF-8?q?=20en=20cascade=20+=20correction=20sur=20le=20force=20rendering?= =?UTF-8?q?=20apr=C3=A8s=20un=20changement=20de=20competence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/module/actor.js b/module/actor.js index 1eed05f0..c8069361 100644 --- a/module/actor.js +++ b/module/actor.js @@ -668,19 +668,23 @@ export class RdDActor extends RdDBaseActorSang { if (!RdDItemRace.checkRacialMax(this, caracName, to)) { return } + let updates = {}; if (caracName == LIST_CARAC_PERSONNAGE.reve.code) { if (to > Misc.toInt(this.system.reve.seuil.value)) { - this.setPointsDeSeuil(to); - } + updates[`system.reve.seuil.value`] = to; // SFA : Direct and packed changes + //this.setPointsDeSeuil(to); + } } if (caracName == LIST_CARAC_PERSONNAGE.chance.code) { if (to > Misc.toInt(this.system.compteurs.chance.value)) { - this.setPointsDeChance(to); + updates[`system.compteurs.chance.value`] = to; // SFA : Direct and packed changes + //this.setPointsDeChance(to); } } let selectedCarac = this.findCaracByName(caracName); const from = selectedCarac.value - await this.update({ [`system.carac.${caracName}.value`]: to }); + updates[`system.carac.${caracName}.value`] = to; + await this.update(updates); await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName); } @@ -784,7 +788,7 @@ export class RdDActor extends RdDBaseActorSang { const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories()); this.notifyCompetencesTronc(competence, toNiveau); const fromNiveau = competence.system.niveau; - await competence.update({ 'system.niveau': toNiveau }, { render: false }) + await competence.update({ 'system.niveau': toNiveau }, { render: true }) await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true); } }