Changed Class/Multiclass to simple getters to avoid having to keep them up to date

This commit is contained in:
WBHarry 2025-08-15 17:39:06 +02:00
parent 006f9dde1f
commit 113ff2a8c5
4 changed files with 26 additions and 49 deletions

View file

@ -42,10 +42,8 @@ export default class DHFeature extends BaseDataItem {
traitValue =
this.actor.system.traits[this.actor.items.get(this.originId).system.spellcastingTrait]?.value ?? 0;
} else {
const subclass =
this.actor.system.multiclass.value?.id === this.originId
? this.actor.system.multiclass.subclass
: this.actor.system.class.subclass;
const { value: multiclass, subclas } = this.actor.system.multiclass;
const subclass = multiclass?.id === this.originId ? subclass : this.actor.system.class.subclass;
traitValue = this.actor.system.traits[subclass.system.spellcastingTrait]?.value ?? 0;
}
}