diff --git a/module.json b/module.json index cb7c2ae..4ad4c23 100644 --- a/module.json +++ b/module.json @@ -5,7 +5,7 @@ "author": "Kandashi", "version": "0.2.12", "minimumCoreVersion": "0.8.3", - "compatibleCoreVersion": "0.8.3", + "compatibleCoreVersion": "0.8.5", "scripts": [ "src/activeLighting.js" diff --git a/src/activeLighting.js b/src/activeLighting.js index d72357a..6f76a65 100644 --- a/src/activeLighting.js +++ b/src/activeLighting.js @@ -1,4 +1,3 @@ - class ATL { static init() { @@ -459,7 +458,7 @@ class ATL { } } else { - let preValue = overrides[updateKey] ? overrides[updateKey] : originals[updateKey] || null; + let preValue = (overrides[updateKey] ? overrides[updateKey] : originals[updateKey]) ?? null; let result = ATL.apply(entity, change, originals, preValue); if (result !== null) { let resultTmp; @@ -570,13 +569,14 @@ class ATL { static applyOverride(token, change, originals, current) { let { key, value, mode } = change; key = key.slice(4) - //const current = typeof getProperty(originals, key) === "number" ? getProperty(originals, key) : getProperty(token.data, key) || null; + // current = typeof getProperty(originals, key) === "number" ? getProperty(originals, key) : getProperty(token.data, key) || null; if (mode === CONST.ACTIVE_EFFECT_MODES.UPGRADE) { if ((typeof (current) === "number") && (current >= Number(value))) return null; } if (mode === CONST.ACTIVE_EFFECT_MODES.DOWNGRADE) { if ((typeof (current) === "number") && (current < Number(value))) return null; } + if (typeof current === "number") return Number(value); return value; } }