Merge branch 'fix-active-effect-application' into 'main'

fix: fix issue where active effects would be applied multiple times

See merge request 
This commit is contained in:
Johannes Loher 2022-12-01 23:02:31 +00:00
commit 4c17736861

View file

@ -152,8 +152,9 @@ export class DS4ActiveEffect extends ActiveEffect {
// Apply all changes
for (const changeWithEffect of changesWithEffect) {
const result = changeWithEffect.effect.apply(document, changeWithEffect.change);
if (result !== null) overrides[changeWithEffect.change.key] = result;
if (!changeWithEffect.change.key) continue;
const changes = changeWithEffect.effect.apply(document, changeWithEffect.change);
Object.assign(overrides, changes);
}
// Expand the set of final overrides