From 4a3b2f6d6344bb225374f6d7a05debb0c2009d44 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 6 Dec 2020 19:31:54 +0100 Subject: [PATCH] gestion de bonus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit utilisation du calcul de réussites existant --- module/rdd-resolution-table.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index 9edf47d3..c1b4e2df 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -90,12 +90,10 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static updateChancesWithBonus( chances, bonus ) { - let newScore = Number(chances.score) + Number(bonus); - chances.score = newScore; - chances.sign = this._reussiteSignificative(newScore); - chances.part = this._reussitePart(newScore); - chances.epart = this._echecParticulier(newScore); - chances.etotal = this._echecTotal(newScore); + if (bonus) { + let newScore = Number(chances.score) + Number(bonus); + mergeObject(chances, this._computeCell(null, newScore), {overwrite: true}); + } } /* -------------------------------------------- */