fix unnecessary fallback and change to uuid field for validation

This commit is contained in:
walther.johnson 2025-07-07 16:33:15 -06:00
parent 4907b4e609
commit fb4af90b07
2 changed files with 4 additions and 4 deletions

View file

@ -536,8 +536,8 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
description: this.description, description: this.description,
actions: [], actions: [],
source: { source: {
actor: this.item?.actor?.uuid ?? this.item?.actor?.id ?? null, actor: this.item?.actor?.uuid ?? null,
item: this.item?.uuid ?? this.item?.id ?? null item: this.item?.uuid ?? null
} }
}; };
const msg = new cls({ const msg = new cls({

View file

@ -9,8 +9,8 @@ export default class DHAbilityUse extends foundry.abstract.TypeDataModel {
name: new fields.StringField({}), name: new fields.StringField({}),
description: new fields.StringField({}), description: new fields.StringField({}),
source: new fields.SchemaField({ source: new fields.SchemaField({
actor: new fields.StringField({ nullable: true }), actor: new fields.DocumentUUIDField({ nullable: true, type: "Actor" }),
item: new fields.StringField({ nullable: true }) item: new fields.DocumentUUIDField({ nullable: true, Type: "Item" })
}), }),
actions: new fields.ArrayField( actions: new fields.ArrayField(
new fields.ObjectField({ new fields.ObjectField({