[Fix] 940 Character Import (#962)

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

* Corrected variable
This commit is contained in:
WBHarry 2025-08-16 01:56:17 +02:00 committed by GitHub
parent 0e43bf197d
commit ab76d9e91d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 50 deletions

View file

@ -42,11 +42,9 @@ 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;
traitValue = this.actor.system.traits[subclass.system.spellcastingTrait]?.value ?? 0;
const { value: multiclass, subclass } = this.actor.system.multiclass;
const selectedSubclass = multiclass?.id === this.originId ? subclass : this.actor.system.class.subclass;
traitValue = this.actor.system.traits[selectedSubclass.system.spellcastingTrait]?.value ?? 0;
}
}