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

This commit is contained in:
Johannes Loher 2022-12-02 00:00:39 +01:00
parent 53216d30cc
commit db6ee373ff

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