diff --git a/changelog.md b/changelog.md index c536f58..1cd45da 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,9 @@ # Changelog ## 2.2.x feature: Time To Craft -### 2.2.2 fix worldtime is zero +### 2.2.2 workaround for ready set roll +This fix should work for the current version of ready set roll 1.3.14. +Might break at any other version ! a request for more robust interface has been made: +### 2.2.1 fix worldtime is zero Crafting does not become success when the worldtime is not advancecd. Sadly I could not automatically fix old crafting processes without breaking unfinished crafting processes. ### 2.2.0 feature: Time To Craft diff --git a/src/Crafting.ts b/src/Crafting.ts index 699fed2..8334617 100644 --- a/src/Crafting.ts +++ b/src/Crafting.ts @@ -116,10 +116,17 @@ export class Crafting implements CraftingData { } else { roll = await this.actor.rollSkill(this.recipe.skill.name); } + let resultValue = roll.total + if(resultValue === undefined){ + if(roll.fields !== undefined && roll.fields[2] !== undefined ){ + resultValue = roll.fields[2][1]?.roll?.total; + } + } + this.result._skill = { dc: this.recipe.skill.dc, name: skillName, - total: roll.total + total: resultValue } } }