Skip to content

Commit

Permalink
Merge pull request #49 from kandashi/0.8.5
Browse files Browse the repository at this point in the history
0.8.5
  • Loading branch information
kandashi authored May 24, 2021
2 parents 1a7e19f + ad9942d commit a805397
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/activeLighting.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class ATL {

static init() {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a805397

Please sign in to comment.