Fix reférence circulaire

La méthode rollData fait le jet fourni dans rollData et l'ajoute dans
rollData.rolled.

Pas besoin de retourner rollData, la tentation est forte de mettre le
résultat dans "rolled"
This commit is contained in:
Vincent Vandemeulebrouck 2020-12-09 00:00:59 +01:00
parent 63e410458e
commit df5954bf75
2 changed files with 1 additions and 2 deletions

View File

@ -142,7 +142,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async performRoll(rollData, attacker = undefined) { async performRoll(rollData, attacker = undefined) {
// garder le résultat // garder le résultat
rollData.rolled = await RdDResolutionTable.rollData(rollData); await RdDResolutionTable.rollData(rollData);
//console.log("performRoll", rollData) //console.log("performRoll", rollData)
if ( !rollData.attackerRoll) {// Store in the registry if not a defense roll if ( !rollData.attackerRoll) {// Store in the registry if not a defense roll

View File

@ -100,7 +100,6 @@ export class RdDResolutionTable {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async rollData(rollData ) { static async rollData(rollData ) {
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData.bonus); rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData.bonus);
return rollData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */