diff --git a/5eShaped/precompiled/scripts/Npc.js b/5eShaped/precompiled/scripts/Npc.js index ed3104505a..2e9b1c9e16 100644 --- a/5eShaped/precompiled/scripts/Npc.js +++ b/5eShaped/precompiled/scripts/Npc.js @@ -227,6 +227,7 @@ export class Npc { const collectionArray = ['hit_dice', 'hit_die']; for (const key in hd) { if (hd.hasOwnProperty(key)) { + collectionArray.push(`hd_${key}`); collectionArray.push(`hd_${key}_max`); collectionArray.push(`hd_${key}_query`); collectionArray.push(`hd_${key}_toggle`); diff --git a/5eShaped/precompiled/scripts/utilities.js b/5eShaped/precompiled/scripts/utilities.js index ca1f3b8a88..05e5d024be 100644 --- a/5eShaped/precompiled/scripts/utilities.js +++ b/5eShaped/precompiled/scripts/utilities.js @@ -386,6 +386,7 @@ const updateHD = (v, finalSetAttrs, hd) => { for (const key in hd) { if (hd.hasOwnProperty(key)) { if (hd[key] && hd[key] !== 0) { + finalSetAttrs[`hd_${key}`] = hd[key]; finalSetAttrs[`hd_${key}_max`] = hd[key]; finalSetAttrs[`hd_${key}_query`] = '?{HD'; for (let x = 1; x <= hd[key]; x++) { @@ -394,6 +395,9 @@ const updateHD = (v, finalSetAttrs, hd) => { finalSetAttrs[`hd_${key}_query`] += '}'; finalSetAttrs[`hd_${key}_toggle`] = 1; } else { + if (!isUndefinedOrEmpty(v[`hd_${key}`])) { + finalSetAttrs[`hd_${key}`] = 0; + } if (!isUndefinedOrEmpty(v[`hd_${key}_max`])) { finalSetAttrs[`hd_${key}_max`] = 0; }