From 24d89266457752560d81eb45ed195489e7561679 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Thu, 18 Feb 2021 13:24:52 +0100 Subject: [PATCH] correctly handle overrides --- src/module/actor/actor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/module/actor/actor.ts b/src/module/actor/actor.ts index 889e8b3..73dff11 100644 --- a/src/module/actor/actor.ts +++ b/src/module/actor/actor.ts @@ -35,6 +35,8 @@ export class DS4Actor extends Actor { } applyActiveEffectsToBaseData(): void { + // reset overrides because our variant of applying active effects does not set them, it only adds overrides + this.overrides = {}; this.applyActiveEffectsFiltered( (change) => !this.derivedDataProperties.includes(change.key) && !this.finalDerivedProperties.includes(change.key), @@ -87,7 +89,7 @@ export class DS4Actor extends Actor { } // Expand the set of final overrides - this.overrides = expandObject({ ...flattenObject(this.overrides ?? {}), ...overrides }); + this.overrides = expandObject({ ...flattenObject(this.overrides), ...overrides }); } protected _getOriginatingItemOfActiveEffect(effect: ActiveEffect): DS4Item | undefined {