correctly handle overrides

This commit is contained in:
Johannes Loher 2021-02-18 13:24:52 +01:00
parent 1e349a3b34
commit 24d8926645

View file

@ -35,6 +35,8 @@ export class DS4Actor extends Actor<DS4ActorData, DS4Item> {
}
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<DS4ActorData, DS4Item> {
}
// Expand the set of final overrides
this.overrides = expandObject({ ...flattenObject(this.overrides ?? {}), ...overrides });
this.overrides = expandObject({ ...flattenObject(this.overrides), ...overrides });
}
protected _getOriginatingItemOfActiveEffect(effect: ActiveEffect<DS4Actor>): DS4Item | undefined {