From 61a75ef0b188d3167f66a0b240b4beeb8a2ae9ae Mon Sep 17 00:00:00 2001 From: Lucian Date: Wed, 12 Apr 2017 20:58:23 +0200 Subject: [PATCH] fix(config): Fix Rest settings fixes #470 --- lib/shaped-config.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/shaped-config.js b/lib/shaped-config.js index 468d7f1..ea76616 100644 --- a/lib/shaped-config.js +++ b/lib/shaped-config.js @@ -440,7 +440,14 @@ const migrator = new Migrator() .addProperty('config.newCharSettings.houserules.hitDiceRecoveredOnALongRest', '***default***') .deleteProperty('config.newCharSettings.hide.hideSavingThrowSuccess') .addProperty('config.newCharSettings.hide.hideTargetAC') - .deleteProperty('config.newCharSettings.display.showRests'); + .deleteProperty('config.newCharSettings.display.showRests') + // 4.7 fix hit points /hit dice + .nextVersion() + .transformConfig((config) => { + const baseConfig = config.config.newCharSettings.houserules; + baseConfig.hitPointsRecoveredOnALongRest = baseConfig.hitPointsRecoveredOnALongRest || '0'; + baseConfig.hitDiceRecoveredOnALongRest = baseConfig.hitDiceRecoveredOnALongRest || '0'; + }, 'Fixing hit points/hit dice settings'); module.exports = class ShapedConfig extends ShapedModule { @@ -844,12 +851,12 @@ module.exports = class ShapedConfig extends ShapedModule { }, houserules: { hitPointsRecoveredOnALongRest: this.getOptionList({ - None: '', + None: '0', Half: 'HALF', All: '***default***', }), hitDiceRecoveredOnALongRest: this.getOptionList({ - None: '', + None: '0', Half: '***default***', All: 'ALL', }),